Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created April 30, 2015 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/a2cbf0bb24ce7575ff9a to your computer and use it in GitHub Desktop.
Save joshcough/a2cbf0bb24ce7575ff9a to your computer and use it in GitHub Desktop.
def sender[T](addr:InetSocketAddress, p: Process[Nothing,T])(implicit c: Codec[T]): Process[Task, ByteVector] = {
val encoder : Process1[T,ByteVector] =scodec.stream.encode.many(c).encoder.map(_.toByteVector)
tcp.connect(addr)(tcp.lift(p.toSource |> encoder))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment