Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zio, zio-streams, zio-test, ... to 2.0.0-M4 #318

Merged
merged 3 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: ['2.12.13', '2.13.6', '3.0.0']
scala: ['2.12.14', '2.13.6', '3.0.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -19,8 +19,8 @@ jobs:
- name: Coursier cache
uses: coursier/cache-action@v5
- name: Build and test
if: ${{ matrix.scala == '3.0.0' }}
if: ${{ matrix.scala == '3.0.2' }}
run: sbt ++${{ matrix.scala }} clean test
- name: Build and test
if: ${{ matrix.scala != '3.0.0' }}
if: ${{ matrix.scala != '3.0.2' }}
run: sbt ++${{ matrix.scala }} clean coverage test coverageReport && bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ val scala213 = "2.13.6"
val scala3 = "3.0.2"

val zioVersion = "1.0.12"
val zio2Version = "2.0.0-M2+83-c286d83c-SNAPSHOT"
val zio2Version = "2.0.0-M4"

val scalacOptions212 = Seq("-Ypartial-unification", "-deprecation", "-target:jvm-1.8")
val scalacOptions213 = Seq("-deprecation", "-target:jvm-1.8")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,21 @@ trait ProxZStream extends Prox {
}
}

private final def flushingOutputStreamSink(managedOutput: ZManaged[Any, Nothing, io.OutputStream]): ZSink[Any, IOException, Byte, Byte, Long] = {
ZSink.managed(managedOutput) { os =>
ZSink.foldLeftChunksZIO(0L) { (bytesWritten, byteChunk: Chunk[Byte]) =>
ZIO.attemptBlockingInterrupt {
val bytes = byteChunk.toArray
os.write(bytes)
os.flush()
bytesWritten + bytes.length
}.refineOrDie {
case e: IOException => e
private final def flushingOutputStreamSink(managedOutput: ZManaged[Any, Nothing, io.OutputStream]): ZSink[Any, IOException, Byte, Byte, Long] =
ZSink.unwrapManaged {
managedOutput.map { os =>
ZSink.foldLeftChunksZIO(0L) { (bytesWritten, byteChunk: Chunk[Byte]) =>
ZIO.attemptBlockingInterrupt {
val bytes = byteChunk.toArray
os.write(bytes)
os.flush()
bytesWritten + bytes.length
}.refineOrDie {
case e: IOException => e
}
}
}
}
}

protected override final def startFiber[A](f: ProxIO[A]): ProxIO[ProxFiber[A]] =
f.fork
Expand Down