-
Notifications
You must be signed in to change notification settings - Fork 605
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
Add readOutputStream
combinator in fs2-io
#1648
Conversation
f91d6fb
to
eb13341
Compare
@Daenyth Anything left on this one? It's still marked as a draft. |
I swear the tests were failing, but it's green now and I haven't changed anything. I have no idea what's up there. |
@mpilquist should be good to go now that it's green |
About the failing tests, I'll repeat it here so it doesn't get lost: it looks like the first test can deadlock on a single-thread |
|
||
Stream.resource(mkOutput).flatMap { | ||
case (os, is) => | ||
val write = f(os) *> Sync[F].delay(os.close()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use blocker.delay
here instead
) { (bytes: Array[Byte], chunkSize: Int) => | ||
Blocker[IO].use { blocker => | ||
readOutputStream[IO](blocker, chunkSize)( | ||
(os: OutputStream) => IO(os.write(bytes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use blocker.delay[IO]
instead (h/t @nigredo-tori)
I still need to finalize the unit tests - I copied what was in my gist with minor adaptations, needs cleaning still
Close #1641