case classDuplexStreamHandle(messages: Offer[ChannelBuffer], onClose: Future[Unit], close: () ⇒ Unit) extends Product with Serializable
DuplexStreamCodec allows you to send and receive messages to server running
the same codec. It sends to you a DuplexStreamHandle that contains:
messages: Offer[ChannelBuffer]
onClose: Future[Unit]
close: () => Unit
and it expects you to send/return to it a Offer[ChannelBuffer] for outbound
messages. This codec synchronizes immediately on outbound messages, and does
not provide you with information about the other side's offer synchronization.
example:
val factory = ClientBuilder()
.codec(DuplexStreamCodec())
.hosts(Seq(address))
.buildFactory()
val service =
factory() onSuccess { client =>
val outbound = new Broker[ChannelBuffer]
val handle: Future[DuplexStreamHandle] = client(outbound.recv)
handle.messages foreach { inboundMessage => ... }
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
DuplexStreamCodec allows you to send and receive messages to server running the same codec. It sends to you a DuplexStreamHandle that contains: