Last active
August 29, 2015 14:26
-
-
Save fiadliel/5abd85c8163a404392af to your computer and use it in GitHub Desktop.
Wrapper to create an outToSource function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object OutputStreamUtils { | |
def outToSource(queueSize: Int)(f: OutputStream => Unit)(implicit S: Strategy): Process[Task, ByteVector] = { | |
val queue = async.boundedQueue[ByteVector](queueSize) | |
val qos = new QueueOutputStream(queue) | |
S(f(qos)) | |
queue.dequeue | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment