Skip to content

Commit

Permalink
Updates after review
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlar committed Sep 30, 2024
1 parent 4bff266 commit 2caf4cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zio-http/jvm/src/main/scala/zio/http/netty/NettyBody.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ object NettyBody extends BodyEncoding {
queue <- ZIO.acquireRelease(Queue.unbounded[Take[E, A]])(_.shutdown)
runtime <- ZIO.runtime[R]
} yield {
val rtm = runtime.unsafe
val maybeRead = ZChannel.fromZIO(nettyRead.whenZIODiscard(queue.isEmpty))
val rtm = runtime.unsafe
register { k =>
try {
rtm
Expand All @@ -174,7 +175,7 @@ object NettyBody extends BodyEncoding {
maybeError =>
ZChannel.fromZIO(queue.shutdown) *>
maybeError.fold[ZChannel[Any, Any, Any, Any, E, Chunk[A], Unit]](ZChannel.unit)(ZChannel.fail(_)),
a => ZChannel.write(a) *> ZChannel.fromZIO(nettyRead.whenZIO(queue.isEmpty)) *> loop,
a => ZChannel.write(a) *> maybeRead *> loop,
),
)

Expand Down

0 comments on commit 2caf4cf

Please sign in to comment.