Click or drag to resize
Akka.NETSink Class
TBD
Inheritance Hierarchy
System.Object
  Akka.Streams.Dsl.Sink

Namespace:  Akka.Streams.Dsl
Assembly:  Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax
public static class Sink

The Sink type exposes the following members.

Methods
  NameDescription
Public methodStatic memberActorRef<TIn>
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 Status. Failure 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 Sink<TIn, TMat>.
Public methodStatic memberActorRefWithAck<TIn>
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.
Public methodStatic memberActorSubscriber<TIn>
Public methodStatic memberAggregate<TIn, TOut>
A Sink< TIn, 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.
Public methodStatic memberAggregateAsync<TIn, TOut>
A Sink< TIn, 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.
Public methodStatic memberAsPublisher<TIn>
A Sink< TIn, 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.
Public methodStatic memberCancelled<TIn>
Public methodStatic memberCombine<TIn, TOut, TMat>
Public methodStatic memberCreate<TIn>
Public methodStatic memberFanoutPublisher<TIn>
Public methodStatic memberFirst<TIn>
A Sink< TIn, TMat> that materializes into a Task< TResult> 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.
Public methodStatic memberFirstOrDefault<TIn>
A Sink< TIn, TMat> that materializes into a Task< TResult> 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.
Public methodStatic memberForEach<TIn>
A Sink< TIn, 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..
Public methodStatic memberForEachParallel<TIn>
A Sink< TIn, 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

Public methodStatic memberFromGraph<TIn, TMat>
A graph with the shape of a sink logically is a sink, this method makes it so also in type.
Public methodStatic memberFromSubscriber<TIn>
Public methodStatic memberIgnore<TIn>
Public methodStatic memberLast<TIn>
A Sink< TIn, TMat> that materializes into a Task< TResult> 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.
Public methodStatic memberLastOrDefault<TIn>
A Sink< TIn, TMat> that materializes into a Task< TResult> 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.
Public methodStatic memberLazySink<TIn, TMat>
Creates a real Sink< TIn, TMat> upon receiving the first element. Internal Sink< TIn, 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.
Public methodStatic memberOnComplete<TIn>
A Sink< TIn, TMat> that when the flow is completed, either through a failure or normal completion, apply the provided function with success or failure.
Public methodStatic memberPublisher<TIn>
Public methodStatic memberQueue<TIn>

Creates a Sink< TIn, TMat> that is materialized as an ISinkQueue<T>. PullAsync() method is pulling element from the stream and returns Task<TResult>. 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.

Sink< TIn, 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 ISinkQueue< T> including last None as completion marker.

Public methodStatic memberSeq<TIn>
TBD
Public methodStatic memberShape<T>
TBD
Public methodStatic memberSum<TIn>
A Sink< TIn, 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 Task< TResult> 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.
Public methodStatic memberWrap<TIn, TMat>
A graph with the shape of a sink logically is a sink, this method makes it so also in type.
Top
See Also