| SourceActorRefT Method |
Creates a
SourceTOut, TMat that is materialized as an
IActorRef.
Messages sent to this actor will be emitted to the stream if there is demand from downstream,
otherwise they will be buffered until request for demand is received.
Depending on the defined
OverflowStrategy it might drop elements if
there is no space available in the buffer.
The strategy
Backpressure is not supported, and an
IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument.
The buffer can be disabled by using
bufferSize of 0 and then received messages are dropped
if there is no demand from downstream. When
bufferSize is 0 the
overflowStrategy does
not matter. An async boundary is added after this Source; as such, it is never safe to assume the downstream will always generate demand.
The stream can be completed successfully by sending the actor reference a
StatusSuccess
message (whose content will be ignored) in which case already buffered elements will be signaled before signaling completion,
or by sending
PoisonPill in which case completion will be signaled immediately.
The stream can be completed with failure by sending a
StatusFailure to the
actor reference. In case the Actor is still draining its internal buffer (after having received
a
StatusSuccess) before signaling completion and it receives a
StatusFailure,
the failure will be signaled downstream immediately (instead of the completion signal).
The actor will be stopped when the stream is completed, failed or canceled from downstream,
i.e. you can watch it to get notified when that happens.
Namespace:
Akka.Streams.Dsl
Assembly:
Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax public static Source<T, IActorRef> ActorRef<T>(
int bufferSize,
OverflowStrategy overflowStrategy
)
static member ActorRef :
bufferSize : int *
overflowStrategy : OverflowStrategy -> Source<'T, IActorRef>
Parameters
- bufferSize
- Type: SystemInt32
The size of the buffer in element count - overflowStrategy
- Type: Akka.StreamsOverflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
Type Parameters
- T
- TBD
Return Value
Type:
SourceT,
IActorRefTBD
Exceptions See Also