Click or drag to resize
Akka.NETSource Methods

The Source type exposes the following members.

Methods
  NameDescription
Public methodStatic memberActorPublisherT
Public methodStatic memberActorRefT
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.
Public methodStatic memberAsSubscriberT
Public methodStatic memberCombineT, TOut2
Public methodStatic memberCycleT
Create SourceTOut, TMat that will continually produce given elements in specified order. Start a new cycled SourceTOut, TMat from the given elements. The producer stream of elements will continue infinitely by repeating the sequence of elements provided by function parameter.
Public methodStatic memberEmptyT
Public methodStatic memberFailedT
Public methodStatic memberFromT
Public methodStatic memberFromEnumeratorT
Public methodStatic memberFromGraphT, TMat
A graph with the shape of a source logically is a source, this method makes it so also in type.
Public methodStatic memberFromPublisherT
Helper to create SourceTOut, TMat from IPublisher. Construct a transformation starting with given publisher. The transformation steps are executed by a series of IProcessor instances that mediate the flow of elements downstream and the propagation of back-pressure upstream.
Public methodStatic memberFromTaskT
Public methodStatic memberMaybeT
Create a SourceTOut, TMat which materializes a TaskCompletionSourceTResult which controls what element will be emitted by the Source. If the materialized promise is completed with a Some, that value will be produced downstream, followed by completion. If the materialized promise is completed with a None, no value will be produced downstream and completion will be signaled immediately. If the materialized promise is completed with a failure, then the returned source will terminate with that error. If the downstream of this source cancels before the promise has been completed, then the promise will be completed with None.
Public methodStatic memberQueueT
Creates a SourceTOut, TMat that is materialized as an ISourceQueueWithCompleteT. You can push elements to the queue and they 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. Acknowledgement mechanism is available. [!:ISourceQueueWithComplete<T>.OfferAsync] returns Task which completes with true if element was added to buffer or sent downstream. It completes with false if element was dropped. The strategy Backpressure will not complete [!:ISourceQueueWithComplete<T>.OfferAsync] until buffer is full. 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.
Public methodStatic memberRepeatT
Public methodStatic memberShapeT
TBD
Public methodStatic memberSingleT
Public methodStatic memberTickT
Elements are emitted periodically with the specified interval. The tick element will be delivered to downstream consumers that has requested any elements. If a consumer has not requested any elements at the point in time when the tick element is produced it will not receive that tick element later. It will receive new tick elements as soon as it has requested more elements.
Public methodStatic memberCode exampleUnfoldTState, TElem
Create a SourceTOut, TMat that will unfold a value of type TState into a pair of the next state TState and output elements of type TElem.
Public methodStatic memberCode exampleUnfoldAsyncTState, TElem
Public methodStatic memberCode exampleUnfoldInfiniteTState, TElem
Public methodStatic memberUnfoldResourceT, TSource
Start a new SourceTOut, TMat from some resource which can be opened, read and closed. Interaction with resource happens in a blocking way. Example: {{{ Source.unfoldResource( () => new BufferedReader(new FileReader("...")), reader => Option(reader.readLine()), reader => reader.close()) }}} You can use the supervision strategy to handle exceptions for read function. All exceptions thrown by create or close will fail the stream. Restart supervision strategy will close and create blocking IO again. Default strategy is Stop which means that stream will be terminated on error in `read` function by default. You can configure the default dispatcher for this Source by changing the `akka.stream.blocking-io-dispatcher` or set it for a given Source by using CreateDispatcher(String).
Public methodStatic memberUnfoldResourceAsyncT, TSource
Start a new SourceTOut, TMat from some resource which can be opened, read and closed. It's similar to UnfoldResourceT, TSource(FuncTSource, FuncTSource, OptionT, ActionTSource) but takes functions that return Tasks instead of plain values. You can use the supervision strategy to handle exceptions for read function or failures of produced Tasks. All exceptions thrown by create or close as well as fails of returned futures will fail the stream. Restart supervision strategy will close and create resource .Default strategy is Stop which means that stream will be terminated on error in read function (or task) by default. You can configure the default dispatcher for this Source by changing the `akka.stream.blocking-io-dispatcher` or set it for a given Source by using CreateDispatcher(String).
Public methodStatic memberZipNT
Combines the elements of multiple streams into a stream of lists.
Public methodStatic memberZipWithNT, TOut2
Combines the elements of multiple streams into a stream of sequences using a combiner function.
Top
See Also