object SynchronousMappedStreams
- Alphabetic
- By Inheritance
- SynchronousMappedStreams
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
contramap[A, B](subscriber: Subscriber[B], f: (A) ⇒ B): Subscriber[A]
Contramaps a subscriber using a synchronous function.
Contramaps a subscriber using a synchronous function.
This is useful in situations where you want to guarantee that messages that you produce always reach passed to the subscriber are always handled, but can't guarantee that the subscriber being contramapped will always handle them. For example, a subscriber that consumes Netty
ByteBuf
can't subscribe directly to an Akka streams publisher since Akka streams may drop the messages its publishing without giving any opportunity to release theByteBuf
, this can be used to to convert some other immutable message to aByteBuf
for consumption by the Netty subscriber. -
def
map[A, B](publisher: Publisher[A], f: (A) ⇒ B): Publisher[B]
Maps a publisher using a synchronous function.
Maps a publisher using a synchronous function.
This is useful in situations where you want to guarantee that messages produced by the publisher are always handled, but can't guarantee that the subscriber passed to it will always handle them. For example, a publisher that produces Netty
ByteBuf
can't be fed directly into an Akka streams subscriber since Akka streams may drop the message without giving any opportunity to release theByteBuf
, this can be used to consume theByteBuf
and then release it. -
def
transform[A1, B1, A2, B2](processor: Processor[B1, A2], f: (A1) ⇒ B1, g: (A2) ⇒ B2): Processor[A1, B2]
Does a map and contramap on the processor.