public class ActorFlow extends Object
See https://github.com/akka/akka/issues/16985.
Constructor and Description |
---|
ActorFlow() |
Modifier and Type | Method and Description |
---|---|
static <In,Out> akka.stream.javadsl.Flow<In,Out,?> |
actorRef(Function<akka.actor.ActorRef,akka.actor.Props> props,
akka.actor.ActorRefFactory factory,
akka.stream.Materializer mat)
Create a flow that is handled by an actor.
|
static <In,Out> akka.stream.javadsl.Flow<In,Out,?> |
actorRef(Function<akka.actor.ActorRef,akka.actor.Props> props,
int bufferSize,
akka.stream.OverflowStrategy overflowStrategy,
akka.actor.ActorRefFactory factory,
akka.stream.Materializer mat)
Create a flow that is handled by an actor.
|
public static <In,Out> akka.stream.javadsl.Flow<In,Out,?> actorRef(Function<akka.actor.ActorRef,akka.actor.Props> props, int bufferSize, akka.stream.OverflowStrategy overflowStrategy, akka.actor.ActorRefFactory factory, akka.stream.Materializer mat)
Messages can be sent downstream by sending them to the actor passed into the props function.
This actor meets the contract of the actor returned by Source.actorRef(int, akka.stream.OverflowStrategy)
.
The props function should return the props for an actor to handle the flow. This actor will
be created using the passed in ActorRefFactory
. Each message received will
be sent to the actor - there is no back pressure, if the actor is unable to process the
messages, they will queue up in the actors mailbox. The upstream can be cancelled by the actor
terminating itself.
In
- the In type parameter for a FlowOut
- the Out type parameter for a Flowprops
- A function that creates the props for actor to handle the flow.bufferSize
- The maximum number of elements to buffer.overflowStrategy
- The strategy for how to handle a buffer overflow.factory
- The Actor Factory used to create the actor to handle the flow - for example, an
ActorSystem.mat
- The materializer to materialize the flow.public static <In,Out> akka.stream.javadsl.Flow<In,Out,?> actorRef(Function<akka.actor.ActorRef,akka.actor.Props> props, akka.actor.ActorRefFactory factory, akka.stream.Materializer mat)
Messages can be sent downstream by sending them to the actor passed into the props function.
This actor meets the contract of the actor returned by Source.actorRef(int, akka.stream.OverflowStrategy)
, defaulting to a buffer size of 16, and failing the stream
if the buffer gets full.
The props function should return the props for an actor to handle the flow. This actor will
be created using the passed in ActorRefFactory
. Each message received will
be sent to the actor - there is no back pressure, if the actor is unable to process the
messages, they will queue up in the actors mailbox. The upstream can be cancelled by the actor
terminating itself.
In
- the In type parameter for a FlowOut
- the Out type parameter for a Flowprops
- A function that creates the props for actor to handle the flow.factory
- The Actor Factory used to create the actor to handle the flow - for example, an
ActorSystem.mat
- The materializer to materialize the flow.