Sink Methods |
The Sink type exposes the following members.
Name | Description | |
---|---|---|
ActorRefTIn |
Sends the elements of the stream to the given IActorRef.
If the target actor terminates the stream will be canceled.
When the stream is completed successfully the given onCompleteMessage
will be sent to the destination actor.
When the stream is completed with failure a StatusFailure
message will be sent to the destination actor.
It will request at most MaxInputBufferSize number of elements from
upstream, but there is no back-pressure signal from the destination actor,
i.e. if the actor is not consuming the messages fast enough the mailbox
of the actor will grow. For potentially slow consumer actors it is recommended
to use a bounded mailbox with zero PushTimeOut or use a rate
limiting stage in front of this SinkTIn, TMat.
| |
ActorRefWithAckTIn |
Sends the elements of the stream to the given IActorRef that sends back back-pressure signal.
First element is always onInitMessage, then stream is waiting for acknowledgement message
ackMessage from the given actor which means that it is ready to process
elements.It also requires ackMessage message after each stream element
to make backpressure work.
If the target actor terminates the stream will be canceled.
When the stream is completed successfully the given onCompleteMessage
will be sent to the destination actor.
When the stream is completed with failure - result of onFailureMessage
function will be sent to the destination actor.
| |
ActorSubscriberTIn |
Creates a SinkTIn, TMat that is materialized to an IActorRef which points to an Actor
created according to the passed in Props. Actor created by the props should
be ActorSubscriberSinkTIn.
| |
AggregateTIn, TOut |
A SinkTIn, TMat that will invoke the given aggregate function for every received element,
giving it its previous output (or the given zero value) and the element as input.
The returned Task will be completed with value of the final
function evaluation when the input stream ends, or completed with the streams exception
if there is a failure signaled in the stream.
| |
AggregateAsyncTIn, TOut |
A SinkTIn, TMat that will invoke the given asynchronous function for every received element,
giving it its previous output (or the given zero value) and the element as input.
The returned Task will be completed with value of the final
function evaluation when the input stream ends, or completed with "Failure"
if there is a failure signaled in the stream.
| |
AsPublisherTIn |
A SinkTIn, TMat that materializes into a IPublisher.
If fanout is true, the materialized IPublisher will support multiple ISubscriber`s and
the size of the MaxInputBufferSize configured for this stage becomes the maximum number of elements that
the fastest ISubscriber can be ahead of the slowest one before slowing
the processing down due to back pressure.
If fanout is false then the materialized IPublisher will only support a single ISubscriber and
reject any additional ISubscriber`s.
| |
CancelledTIn |
A SinkTIn, TMat that immediately cancels its upstream after materialization.
| |
CombineTIn, TOut, TMat | ||
CreateTIn |
Helper to create SinkTIn, TMat from ISubscriber.
| |
FanoutPublisherTIn | ||
FirstTIn |
A SinkTIn, TMat that materializes into a TaskTResult of the first value received.
If the stream completes before signaling at least a single element, the Task will be failed with a NoSuchElementException.
If the stream signals an error before signaling at least a single element, the Task will be failed with the streams exception.
| |
FirstOrDefaultTIn |
A SinkTIn, TMat that materializes into a TaskTResult of the first value received.
If the stream completes before signaling at least a single element, the Task will return default value.
If the stream signals an error errors before signaling at least a single element, the Task will be failed with the streams exception.
| |
ForEachTIn |
A SinkTIn, TMat that will invoke the given action for each received element.
The sink is materialized into a Task will be completed with success when reaching the
normal end of the stream, or completed with a failure if there is a failure signaled in
the stream..
| |
ForEachParallelTIn |
A SinkTIn, TMat that will invoke the given action
to each of the elements as they pass in. The sink is materialized into a Task.
If the action throws an exception and the supervision decision is
Stop the Task will be completed with failure.
If the action throws an exception and the supervision decision is
Resume or Restart the
element is dropped and the stream continues.
See also | |
FromGraphTIn, TMat |
A graph with the shape of a sink logically is a sink, this method makes
it so also in type.
| |
FromSubscriberTIn |
Helper to create SinkTIn, TMat from ISubscriber.
| |
IgnoreTIn |
A SinkTIn, TMat that will consume the stream and discard the elements.
| |
LastTIn |
A SinkTIn, TMat that materializes into a TaskTResult of the last value received.
If the stream completes before signaling at least a single element, the Task will be failed with a NoSuchElementException.
If the stream signals an error errors before signaling at least a single element, the Task will be failed with the streams exception.
| |
LastOrDefaultTIn |
A SinkTIn, TMat that materializes into a TaskTResult of the last value received.
If the stream completes before signaling at least a single element, the Task will be return a default value.
If the stream signals an error errors before signaling at least a single element, the Task will be failed with the streams exception.
| |
LazySinkTIn, TMat |
Creates a real SinkTIn, TMat upon receiving the first element. Internal SinkTIn, TMat will not be created if there are no elements,
because of completion or error.
If sinkFactory throws an exception and the supervision decision is Stop
the Task will be completed with failure. For all other supervision options it will try to create sink with next element.
fallback will be executed when there was no elements and completed is received from upstream.
| |
OnCompleteTIn |
A SinkTIn, TMat that when the flow is completed, either through a failure or normal
completion, apply the provided function with success or failure.
| |
PublisherTIn | ||
QueueTIn | Creates a SinkTIn, TMat that is materialized as an ISinkQueueT. PullAsync method is pulling element from the stream and returns TaskTResult. Task completes when element is available. Before calling the pull method a second time you need to wait until previous future completes. Pull returns failed future with IllegalStateException if previous future has not yet completed. SinkTIn, TMat will request at most number of elements equal to size of inputBuffer from upstream and then stop back pressure. You can configure size of input by using WithAttributes method. For stream completion you need to pull all elements from ISinkQueueT including last None as completion marker. | |
SeqTIn |
TBD
| |
ShapeT |
TBD
| |
SumTIn |
A SinkTIn, TMat that will invoke the given reduce for every received element, giving it its previous
output (from the second element) and the element as input.
The returned TaskTResult will be completed with value of the final
function evaluation when the input stream ends, or completed with `Failure`
if there is a failure signaled in the stream.
If the stream is empty (i.e. completes before signaling any elements),
the sum stage will fail its downstream with a NoSuchElementException,
which is semantically in-line with that standard library collections do in such situations.
| |
WrapTIn, TMat |
A graph with the shape of a sink logically is a sink, this method makes
it so also in type.
|