Click or drag to resize
Akka.NETSourceOperations Class
TBD
Inheritance Hierarchy
SystemObject
  Akka.Streams.DslSourceOperations

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

The SourceOperations type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAggregateTOut1, TOut2, TMat
Similar to ScanTOut1, TOut2, TMat(SourceTOut1, TMat, TOut2, FuncTOut2, TOut1, TOut2) but only emits its result when the upstream completes, after which it also completes. Applies the given function fold towards its current and next value, yielding the next current value. If the function fold throws an exception and the supervision decision is Restart current value starts at zero again the stream will continue.

Emits when upstream completes

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberAggregateAsyncTOut1, TOut2, TMat
Similar to AggregateTOut1, TOut2, TMat(SourceTOut1, TMat, TOut2, FuncTOut2, TOut1, TOut2) but with an asynchronous function. Applies the given function towards its current and next value, yielding the next current value. If the function fold returns a failure and the supervision decision is Restart current value starts at zero again the stream will continue.

Emits when upstream completes

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberAlsoToTOut, TMat
Attaches the given to this IFlowTOut, TMat, meaning that elements that passes through will also be sent to the . Emits when element is available and demand exists both from the Sink and the downstream. Backpressures when downstream or Sink backpressures Completes when upstream completes Cancels when downstream cancels
Public methodStatic memberAlsoToMaterializedTOut, TMat, TMat2, TMat3
Attaches the given to this IFlowTOut, TMat, meaning that elements that passes through will also be sent to the . @see It is recommended to use the internally optimized and combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberBackpressureTimeoutTOut, TMat
If the time between the emission of an element and the following downstream demand exceeds the provided timeout, the stream is failed with a TimeoutException. The timeout is checked periodically, so the resolution of the check is one period (equals to timeout value).

Emits when upstream emits an element

Backpressures when downstream backpressures

Completes when upstream completes or fails if timeout elapses between element emission and downstream demand.

Cancels when downstream cancels
Public methodStatic memberBatchTOut, TOut2, TMat
Allows a faster upstream to progress independently of a slower subscriber by aggregating elements into batches until the subscriber is ready to accept them.For example a batch step might store received elements in an array up to the allowed max limit if the upstream publisher is faster. This only rolls up elements if the upstream is faster, but if the downstream is faster it will not duplicate elements. Emits when downstream stops backpressuring and there is an aggregated element available Backpressures when there are max batched elements and 1 pending element and downstream backpressures Completes when upstream completes and there is no batched/pending element waiting Cancels when downstream cancels See also ,
Public methodStatic memberBatchWeightedTOut, TOut2, TMat
Allows a faster upstream to progress independently of a slower subscriber by aggregating elements into batches until the subscriber is ready to accept them.For example a batch step might concatenate ByteString elements up to the allowed max limit if the upstream publisher is faster. This element only rolls up elements if the upstream is faster, but if the downstream is faster it will not duplicate elements. Batching will apply for all elements, even if a single element cost is greater than the total allowed limit. In this case, previous batched elements will be emitted, then the "heavy" element will be emitted (after being applied with the seed function) without batching further elements with it, and then the rest of the incoming elements are batched. Emits when downstream stops backpressuring and there is a batched element available Backpressures when there are max weighted batched elements + 1 pending element and downstream backpressures Completes when upstream completes and there is no batched/pending element waiting Cancels when downstream cancels See also ,
Public methodStatic memberBufferTOut, TMat
Adds a fixed size buffer in the flow that allows to store elements from a faster upstream until it becomes full. Depending on the defined OverflowStrategy it might drop elements or backpressure the upstream if there is no space available

Emits when downstream stops backpressuring and there is a pending element in the buffer

Backpressures when depending on OverflowStrategy

* Backpressure - backpressures when buffer is full

* DropHead, DropTail, DropBuffer - never backpressures

* Fail - fails the stream if buffer gets full

Completes when upstream completes and buffered elements has been drained

Cancels when downstream cancels
Public methodStatic memberCollectTOut1, TOut2, TMat
Transform this stream by applying the given function collector to each of the elements on which the function is defined (read: returns not null) as they pass through this processing step. Non-matching elements are filtered out.

Emits when the provided function collector is defined for the element

Backpressures when the function collector is defined for the element and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberCompletionTimeoutTOut, TMat
If the completion of the stream does not happen until the provided timeout, the stream is failed with a TimeoutException.

Emits when upstream emits an element

Backpressures when downstream backpressures

Completes when upstream completes or fails if timeout elapses before upstream completes

Cancels when downstream cancels
Public methodStatic memberConcatTOut, TMat
Concatenate the given SourceTOut, TMat to this IFlowTOut, TMat, meaning that once this Flow’s input is exhausted and all result elements have been generated, the Source’s elements will be produced. Note that the SourceTOut, TMat is materialized together with this IFlowTOut, TMat and just kept from producing elements by asserting back-pressure until its time comes. If this IFlowTOut, TMat gets upstream error - no elements from the given SourceTOut, TMat will be pulled.

Emits when element is available from current stream or from the given SourceTOut, TMat when current is completed

Backpressures when downstream backpressures

Completes when given SourceTOut, TMat completes

Cancels when downstream cancels
Public methodStatic memberConcatManyTOut1, TOut2, TMat
Transform each input element into a SourceTOut, TMat of output elements that is then flattened into the output stream by concatenation, fully consuming one Source after the other.

Emits when a currently consumed substream has an element available

Backpressures when downstream backpressures

Completes when upstream completes and all consumed substreams complete

Cancels when downstream cancels
Public methodStatic memberConflateTOut, TMat
Allows a faster upstream to progress independently of a slower subscriber by conflating elements into a summary until the subscriber is ready to accept them. For example a conflate step might average incoming numbers if the upstream publisher is faster. This version of conflate does not change the output type of the stream. See ConflateWithSeedTOut, TMat, TSeed(SourceTOut, TMat, FuncTOut, TSeed, FuncTSeed, TOut, TSeed) for a more flexible version that can take a seed function and transform elements while rolling up. This element only rolls up elements if the upstream is faster, but if the downstream is faster it will not duplicate elements.

Emits when downstream stops backpressuring and there is a conflated element available

Backpressures when never

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberConflateWithSeedTOut, TMat, TSeed
Allows a faster upstream to progress independently of a slower subscriber by conflating elements into a summary until the subscriber is ready to accept them. For example a conflate step might average incoming numbers if the upstream publisher is faster. This version of conflate allows to derive a seed from the first element and change the aggregated type to be different than the input type. See ConflateTOut, TMat(SourceTOut, TMat, FuncTOut, TOut, TOut) for a simpler version that does not change types. This element only rolls up elements if the upstream is faster, but if the downstream is faster it will not duplicate elements.

Emits when downstream stops backpressuring and there is a conflated element available

Backpressures when never

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberDelayTOut, TMat
Shifts elements emission in time by a specified amount. It allows to store elements in internal buffer while waiting for next element to be emitted. Depending on the defined DelayOverflowStrategy it might drop elements or backpressure the upstream if there is no space available in the buffer. Delay precision is 10ms to avoid unnecessary timer scheduling cycles Internal buffer has default capacity 16. You can set buffer size by calling CreateInputBuffer(Int32, Int32)

Emits when there is a pending element in the buffer and configured time for this element elapsed

* EmitEarly - strategy do not wait to emit element if buffer is full

Backpressures when depending on OverflowStrategy

* Backpressure - backpressures when buffer is full

* DropHead, DropTail, DropBuffer - never backpressures

* Fail - fails the stream if buffer gets full

Completes when upstream completes and buffered elements has been drained

Cancels when downstream cancels
Public methodStatic memberDetachTOut, TMat
Detaches upstream demand from downstream demand without detaching the stream rates; in other words acts like a buffer of size 1. Emits when upstream emits an element Backpressures when downstream backpressures Completes when upstream completes Cancels when downstream cancels
Public methodStatic memberExpandTOut1, TOut2, TMat
Allows a faster downstream to progress independently of a slower publisher by extrapolating elements from an older element until new element comes from the upstream. For example an expand step might repeat the last element for the subscriber until it receives an update from upstream. This element will never "drop" upstream elements as all elements go through at least one extrapolation step. This means that if the upstream is actually faster than the upstream it will be backpressured by the downstream subscriber. Expand does not support Restart and Resume. Exceptions from the extrapolate function will complete the stream with failure.

Emits when downstream stops backpressuring

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberGroupByTOut, TMat, TKey
This operation demultiplexes the incoming stream into separate output streams, one for each element key. The key is computed for each element using the given function. When a new key is encountered for the first time it is emitted to the downstream subscriber together with a fresh flow that will eventually produce all the elements of the substream for that key. Not consuming the elements from the created streams will stop this processor from processing more elements, therefore you must take care to unblock (or cancel) all of the produced streams even if you want to consume only one of them. If the group by function groupingFunc throws an exception and the supervision decision is Stop the stream and substreams will be completed with failure. If the group by groupingFunc throws an exception and the supervision decision is Resume or Restart the element is dropped and the stream and substreams continue.

Emits when an element for which the grouping function returns a group that has not yet been created. Emits the new group

Backpressures when there is an element pending for a group whose substream backpressures

Completes when upstream completes

Cancels when downstream cancels and all substreams cancel
Public methodStatic memberGroupedTOut, TMat
Chunk up this stream into groups of the given size, with the last group possibly smaller than requested due to end-of-stream. n must be positive, otherwise ArgumentException is thrown.

Emits when the specified number of elements has been accumulated or upstream completed

Backpressures when a group has been assembled and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberGroupedWithinTOut, TMat
Chunk up this stream into groups of elements received within a time window, or limited by the given number of elements, whatever happens first. Empty groups will not be emitted if no elements are received from upstream. The last group before end-of-stream will contain the buffered elements since the previously emitted group. n must be positive, and timeout must be greater than 0 seconds, otherwise ArgumentException is thrown.

Emits when the configured time elapses since the last group has been emitted

Backpressures when the configured time elapses since the last group has been emitted

Completes when upstream completes (emits last group)

Cancels when downstream completes
Public methodStatic memberIdleTimeoutTOut, TMat
If the time between two processed elements exceed the provided timeout, the stream is failed with a TimeoutException. The timeout is checked periodically, so the resolution of the check is one period (equals to timeout value).

Emits when upstream emits an element

Backpressures when downstream backpressures

Completes when upstream completes or fails if timeout elapses between two emitted elements

Cancels when downstream cancels
Public methodStatic memberInitialDelayTOut, TMat
Delays the initial element by the specified duration.

Emits when upstream emits an element if the initial delay is already elapsed

Backpressures when downstream backpressures or initial delay is not yet elapsed

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberInitialTimeoutTOut, TMat
If the first element has not passed through this stage before the provided timeout, the stream is failed with a TimeoutException.

Emits when upstream emits an element

Backpressures when downstream backpressures

Completes when upstream completes or fails if timeout elapses before first element arrives

Cancels when downstream cancels
Public methodStatic memberCode exampleInterleaveT1, T2, TMat
Interleave is a deterministic merge of the given SourceTOut, TMat with elements of this IFlowTOut, TMat. It first emits segmentSize number of elements from this flow to downstream, then - same amount for other source, then repeat process. After one of upstreams is complete than all the rest elements will be emitted from the second one If it gets error from one of upstreams - stream completes with failure.

Emits when element is available from the currently consumed upstream

Backpressures when downstream backpressures. Signal to current upstream, switch to next upstream when received segmentSize elements

Completes when the IFlowTOut, TMat and given SourceTOut, TMat completes

Cancels when downstream cancels
Public methodStatic memberInterleaveMaterializedT1, T2, TMat, TMat2, TMat3
Public methodStatic memberIntersperseTOut, TMat(SourceTOut, TMat, TOut)
Intersperses stream with provided element, similar to how Join(String, String) injects a separator between a collection's elements. Additionally can inject start and end marker elements to stream. In case you want to only prepend or only append an element (yet still use the intercept feature to inject a separator between elements, you may want to use the following pattern instead of the 3-argument version of intersperse (See ConcatTOut, TMat(SourceTOut, TMat, IGraphSourceShapeTOut, TMat) for semantics details).

Emits when upstream emits (or before with the inject element if provided)

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberIntersperseTOut, TMat(SourceTOut, TMat, TOut, TOut, TOut)
Intersperses stream with provided element, similar to how Join(String, String) injects a separator between a collection's elements. Additionally can inject start and end marker elements to stream. In case you want to only prepend or only append an element (yet still use the intercept feature to inject a separator between elements, you may want to use the following pattern instead of the 3-argument version of intersperse (See ConcatTOut, TMat(SourceTOut, TMat, IGraphSourceShapeTOut, TMat) for semantics details).

Emits when upstream emits (or before with the start element if provided)

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberKeepAliveTOut, TInjected, TMat
Injects additional elements if the upstream does not emit for a configured amount of time. In other words, this stage attempts to maintains a base rate of emitted elements towards the downstream. If the downstream backpressures then no element is injected until downstream demand arrives. Injected elements do not accumulate during this period. Upstream elements are always preferred over injected elements.

Emits when upstream emits an element or if the upstream was idle for the configured period

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberLimitT, TMat
Ensure stream boundedness by limiting the number of elements from upstream. If the number of incoming elements exceeds max, it will signal upstream failure StreamLimitReachedException downstream. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step. The stream will be completed without producing any elements if max is zero or negative.

Emits when the specified number of elements to take has not yet been reached

Backpressures when downstream backpressures

Completes when the defined number of elements has been taken or upstream completes

Cancels when the defined number of elements has been taken or downstream cancels
Public methodStatic memberLimitWeightedT, TMat
Ensure stream boundedness by evaluating the cost of incoming elements using a cost function. Exactly how many elements will be allowed to travel downstream depends on the evaluated cost of each element. If the accumulated cost exceeds max, it will signal upstream failure StreamLimitReachedException downstream. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step. The stream will be completed without producing any elements if max is zero or negative.

Emits when the specified number of elements to take has not yet been reached

Backpressures when downstream backpressures

Completes when the defined number of elements has been taken or upstream completes

Cancels when the defined number of elements has been taken or downstream cancels
Public methodStatic memberLogTOut, TMat
Logs elements flowing through the stream as well as completion and erroring. By default element and completion signals are logged on debug level, and errors are logged on Error level. This can be adjusted according to your needs by providing a custom AttributesLogLevels attribute on the given Flow.

Emits when the mapping function returns an element

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberMergeTOut1, TOut2, TMat
Merge the given SourceTOut, TMat to this IFlowTOut, TMat, taking elements as they arrive from input streams, picking randomly when several elements ready.

Emits when one of the inputs has an element available

Backpressures when downstream backpressures

Completes when all upstreams complete

Cancels when downstream cancels
Public methodStatic memberMergeManyTOut1, TOut2, TMat
Transform each input element into a SourceTOut, TMat of output elements that is then flattened into the output stream by merging, where at most breadth substreams are being consumed at any given time.

Emits when a currently consumed substream has an element available

Backpressures when downstream backpressures

Completes when upstream completes and all consumed substreams complete

Cancels when downstream cancels
Public methodStatic memberMergeMaterializedTOut1, TOut2, TMat, TMat2, TMat3
Merge the given SourceTOut, TMat to this IFlowTOut, TMat, taking elements as they arrive from input streams, picking randomly when several elements ready. @see MergeTOut1, TOut2, TMat(SourceTOut1, TMat, IGraphSourceShapeTOut2, TMat, Boolean) It is recommended to use the internally optimized LeftTLeft, TRight(TLeft, TRight) and RightTLeft, TRight(TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberMergeSortedTOut, TMat(SourceTOut, TMat, IGraphSourceShapeTOut, TMat)
Merge the given SourceTOut, TMat to this IFlowTOut, TMat, taking elements as they arrive from input streams, picking always the smallest of the available elements(waiting for one element from each side to be available). This means that possible contiguity of the input streams is not exploited to avoid waiting for elements, this merge will block when one of the inputs does not have more elements(and does not complete).

Emits when one of the inputs has an element available

Backpressures when downstream backpressures

Completes when all upstreams complete

Cancels when downstream cancels
Public methodStatic memberMergeSortedTOut, TMat(SourceTOut, TMat, IGraphSourceShapeTOut, TMat, IComparerTOut)
Merge the given SourceTOut, TMat to this IFlowTOut, TMat, taking elements as they arrive from input streams, picking always the smallest of the available elements(waiting for one element from each side to be available). This means that possible contiguity of the input streams is not exploited to avoid waiting for elements, this merge will block when one of the inputs does not have more elements(and does not complete).

Emits when one of the inputs has an element available

Backpressures when downstream backpressures

Completes when all upstreams complete

Cancels when downstream cancels
Public methodStatic memberMergeSortedTOut, TMat(SourceTOut, TMat, IGraphSourceShapeTOut, TMat, FuncTOut, TOut, Int32)
Merge the given SourceTOut, TMat to this IFlowTOut, TMat, taking elements as they arrive from input streams, picking always the smallest of the available elements(waiting for one element from each side to be available). This means that possible contiguity of the input streams is not exploited to avoid waiting for elements, this merge will block when one of the inputs does not have more elements(and does not complete).

Emits when one of the inputs has an element available

Backpressures when downstream backpressures

Completes when all upstreams complete

Cancels when downstream cancels
Public methodStatic memberMonitorTOut, TMat, TMat2
Materializes to IFlowMonitor that allows monitoring of the the current flow. All events are propagated by the monitor unchanged. Note that the monitor inserts a memory barrier every time it processes an event, and may therefor affect performance. The combine function is used to combine the IFlowMonitor with this flow's materialized value.
Public methodStatic memberOrElseT, TMat
Provides a secondary source that will be consumed if this stream completes without any elements passing by. As soon as the first element comes through this stream, the alternative will be cancelled. Note that this Flow will be materialized together with the SourceTOut, TMat and just kept from producing elements by asserting back-pressure until its time comes or it gets cancelled. On errors the stage is failed regardless of source of the error. '''Emits when''' element is available from first stream or first stream closed without emitting any elements and an element is available from the second stream '''Backpressures when''' downstream backpressures '''Completes when''' the primary stream completes after emitting at least one element, when the primary stream completes without emitting and the secondary stream already has completed or when the secondary stream completes '''Cancels when''' downstream cancels and additionally the alternative is cancelled as soon as an element passes by from this stream.
Public methodStatic memberOrElseMaterializedT, TMat, TMat2, TMat3
Provides a secondary source that will be consumed if this source completes without any elements passing by. As soon as the first element comes through this stream, the alternative will be cancelled. It is recommended to use the internally optimized LeftTLeft, TRight(TLeft, TRight) and RightTLeft, TRight(TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberPrefixAndTailTOut, TMat
Takes up to n elements from the stream and returns a pair containing a strict sequence of the taken element and a stream representing the remaining elements. If n is zero or negative, then this will return a pair of an empty collection and a stream containing the whole upstream unchanged.

Emits when the configured number of prefix elements are available. Emits this prefix, and the rest as a substream

Backpressures when downstream backpressures or substream backpressures

Completes when prefix elements has been consumed and substream has been consumed

Cancels when downstream cancels or substream cancels
Public methodStatic memberPrependTOut1, TOut2, TMat
Prepend the given SourceTOut, TMat to this IFlowTOut, TMat, meaning that before elements are generated from this IFlowTOut, TMat, the Source's elements will be produced until it is exhausted, at which point Flow elements will start being produced. Note that this IFlowTOut, TMat will be materialized together with the SourceTOut, TMat and just kept from producing elements by asserting back-pressure until its time comes. If the given SourceTOut, TMat gets upstream error - no elements from this IFlowTOut, TMat will be pulled. Emits when element is available from the given SourceTOut, TMat or from current stream when the SourceTOut, TMat is completed Backpressures when downstream backpressures Completes when this IFlowTOut, TMat completes Cancels when downstream cancels
Public methodStatic memberRecoverTOut, TMat
Recover allows to send last element on failure and gracefully complete the stream Since the underlying failure signal onError arrives out-of-band, it might jump over existing elements. This stage can recover the failure signal, but not the skipped elements, which will be dropped.

Emits when element is available from the upstream or upstream is failed and partialFunc returns an element

Backpressures when downstream backpressures

Completes when upstream completes or upstream failed with exception pf can handle

Cancels when downstream cancels
Public methodStatic memberRecoverWithTOut, TMat Obsolete.
RecoverWith allows to switch to alternative Source on flow failure. It will stay in effect after a failure has been recovered so that each time there is a failure it is fed into the partialFunc and a new Source may be materialized.

Since the underlying failure signal onError arrives out-of-band, it might jump over existing elements. This stage can recover the failure signal, but not the skipped elements, which will be dropped.

Emits when element is available from the upstream or upstream is failed and element is available from alternative Source

Backpressures when downstream backpressures

Completes when upstream completes or upstream failed with exception partialFunc can handle

Cancels when downstream cancels
Public methodStatic memberRecoverWithRetriesTOut, TMat
RecoverWithRetries allows to switch to alternative Source on flow failure. It will stay in effect after a failure has been recovered up to attempts number of times so that each time there is a failure it is fed into the partialFunc and a new Source may be materialized. Note that if you pass in 0, this won't attempt to recover at all. Passing in -1 will behave exactly the same as RecoverWithRetriesTOut, TMat(SourceTOut, TMat, FuncException, IGraphSourceShapeTOut, TMat, Int32).

Since the underlying failure signal onError arrives out-of-band, it might jump over existing elements. This stage can recover the failure signal, but not the skipped elements, which will be dropped.

Emits when element is available from the upstream or upstream is failed and element is available from alternative Source

Backpressures when downstream backpressures

Completes when upstream completes or upstream failed with exception partialFunc can handle

Cancels when downstream cancels
Public methodStatic memberScanTOut1, TOut2, TMat
Similar to AggregateTOut1, TOut2, TMat(SourceTOut1, TMat, TOut2, FuncTOut2, TOut1, TOut2) but is not a terminal operation, emits its current value which starts at zero and then applies the current and next value to the given function scan, emitting the next current value. If the function scan throws an exception and the supervision decision is Restart current value starts at zero again the stream will continue.

Emits when the function scanning the element returns a new element

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberSelectTIn, TOut, TMat
Transform this stream by applying the given mapper function to each of the elements as they pass through this processing step.

Emits when the mapping function mapper returns an element

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels

Public methodStatic memberSelectAsyncTIn, TOut, TMat
Transform this stream by applying the given function asyncMapper to each of the elements as they pass through this processing step. The function returns a TaskTResult and the value of that task will be emitted downstream. The number of tasks that shall run in parallel is given as the first argument to SelectAsyncTIn, TOut, TMat(SourceTIn, TMat, Int32, FuncTIn, TaskTOut). These tasks may complete in any order, but the elements that are emitted downstream are in the same order as received from upstream. If the group by function asyncMapper throws an exception or if the Task is completed with failure and the supervision decision is Stop the stream will be completed with failure. If the group by function asyncMapper throws an exception or if the Task is completed with failure and the supervision decision is Resume or Restart the element is dropped and the stream continues.

Emits when the task returned by the provided function finishes for the next element in sequence

Backpressures when the number of tasks reaches the configured parallelism and the downstream backpressures or the first task is not completed

Completes when upstream completes and all tasks has been completed and all elements has been emitted

Cancels when downstream cancels

Public methodStatic memberSelectAsyncUnorderedTIn, TOut, TMat
Transform this stream by applying the given function asyncMapper to each of the elements as they pass through this processing step. The function returns a Task and the value of that task will be emitted downstream. As many tasks as requested elements by downstream may run in parallel and each processed element will be emitted dowstream as soon as it is ready, i.e. it is possible that the elements are not emitted downstream in the same order as received from upstream. If the group by function asyncMapper throws an exception or if the Task is completed with failure and the supervision decision is Stop the stream will be completed with failure. If the group by function asyncMapper throws an exception or if theTask is completed with failure and the supervision decision is Resume or Restart the element is dropped and the stream continues.

Emits when any of the tasks returned by the provided function complete

Backpressures when the number of tasks reaches the configured parallelism and the downstream backpressures

Completes when upstream completes and all tasks has been completed and all elements has been emitted

Cancels when downstream cancels

Public methodStatic memberSelectManyTOut1, TOut2, TMat
Transform each input element into a sequence of output elements that is then flattened into the output stream. The returned sequence MUST NOT contain null values, as they are illegal as stream elements - according to the Reactive Streams specification.

Emits when the mapping function mapConcater returns an element or there are still remaining elements from the previously calculated collection

Backpressures when downstream backpressures or there are still remaining elements from the previously calculated collection

Completes when upstream completes and all remaining elements has been emitted

Cancels when downstream cancels

Public methodStatic memberSkipTOut, TMat
Discard the given number of elements at the beginning of the stream. No elements will be dropped if n is zero or negative.

Emits when the specified number of elements has been dropped already

Backpressures when the specified number of elements has been dropped and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberSkipWhileTOut, TMat
Discard elements at the beginning of the stream while predicate is true. All elements will be taken after predicate returns false first time.

Emits when predicate returned false and for all following stream elements

Backpressures when predicate returned false and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberSkipWithinTOut, TMat
Discard the elements received within the given duration at beginning of the stream.

Emits when the specified time elapsed and a new upstream element arrives

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberSlidingTOut, TMat
Apply a sliding window over the stream and return the windows as groups of elements, with the last group possibly smaller than requested due to end-of-stream. n must be positive, otherwise IllegalArgumentException is thrown. step must be positive, otherwise IllegalArgumentException is thrown.

Emits when enough elements have been collected within the window or upstream completed

Backpressures when a window has been assembled and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberSplitAfterTOut, TMat(SourceTOut, TMat, FuncTOut, Boolean)
This operation applies the given predicate to all incoming elements and emits them to a stream of output streams. It *ends* the current substream when the predicate is true.
Public methodStatic memberSplitAfterTOut, TMat(SourceTOut, TMat, SubstreamCancelStrategy, FuncTOut, Boolean)
This operation applies the given predicate to all incoming elements and emits them to a stream of output streams.It * ends * the current substream when the predicate is true. This means that for the following series of predicate values, three substreams will be produced with lengths 2, 2, and 3: {{{ false, true, // elements go into first substream false, true, // elements go into second substream false, false, true // elements go into third substream }}} The object returned from this method is not a normal [[Source]] or[[Flow]], it is a SubFlowTOut, TMat, TClosed. This means that after this combinator all transformations are applied to all encountered substreams in the same fashion.Substream mode is exited either by closing the substream(i.e.connecting it to a [[Sink]]) or by merging the substreams back together; see the ToTMat2(IGraphSinkShapeTOut, TMat2) and MergeSubstreams methods on SubFlowTOut, TMat, TClosed for more information. It is important to note that the substreams also propagate back-pressure as any other stream, which means that blocking one substream will block the SplitAfterTOut, TMat(SourceTOut, TMat, SubstreamCancelStrategy, FuncTOut, Boolean) operator itself—and thereby all substreams—once all internal or explicit buffers are filled. If the split predicate throws an exception and the supervision decision is Stop the stream and substreams will be completed with failure. If the split predicate throws an exception and the supervision decision is Resume or Restart the element is dropped and the stream and substreams continue.

Emits when an element passes through.When the provided predicate is true it emits the element and opens a new substream for subsequent element

Backpressures when there is an element pending for the next substream, but the previous is not fully consumed yet, or the substream backpressures

Completes when upstream completes

Cancels when downstream cancels and substreams cancel
Public methodStatic memberSplitWhenTOut, TMat(SourceTOut, TMat, FuncTOut, Boolean)
This operation applies the given predicate to all incoming elements and emits them to a stream of output streams, always beginning a new one with the current element if the given predicate returns true for it.
Public methodStatic memberSplitWhenTOut, TMat(SourceTOut, TMat, SubstreamCancelStrategy, FuncTOut, Boolean)
This operation applies the given predicate to all incoming elements and emits them to a stream of output streams, always beginning a new one with the current element if the given predicate returns true for it. This means that for the following series of predicate values, three substreams will be produced with lengths 1, 2, and 3: {{{ false, // element goes into first substream true, false, // elements go into second substream true, false, false // elements go into third substream }}} In case the * first * element of the stream matches the predicate, the first substream emitted by splitWhen will start from that element. For example: {{{ true, false, false // first substream starts from the split-by element true, false // subsequent substreams operate the same way }}} The object returned from this method is not a normal SourceTOut, TMat or FlowTIn, TOut, TMat, it is a SubFlowTOut, TMat, TClosed. This means that after this combinator all transformations are applied to all encountered substreams in the same fashion. Substream mode is exited either by closing the substream (i.e. connecting it to a SinkTIn, TMat) or by merging the substreams back together; see the ToTMat2(IGraphSinkShapeTOut, TMat2) and MergeSubstreams methods on SubFlowTOut, TMat, TClosed for more information. It is important to note that the substreams also propagate back-pressure as any other stream, which means that blocking one substream will block the SplitWhenTOut, TMat(SourceTOut, TMat, SubstreamCancelStrategy, FuncTOut, Boolean) operator itself—and thereby all substreams—once all internal or explicit buffers are filled. If the split predicate throws an exception and the supervision decision is Stop the stream and substreams will be completed with failure. If the split predicate throws an exception and the supervision decision is Resume or Restart the element is dropped and the stream and substreams continue.

Emits when an element for which the provided predicate is true, opening and emitting a new substream for subsequent element

Backpressures when there is an element pending for the next substream, but the previous is not fully consumed yet, or the substream backpressures

Completes when upstream completes

Cancels when downstream cancels and substreams cancel
Public methodStatic memberStatefulSelectManyTOut1, TOut2, TMat
Transform each input element into an Enumerable of output elements that is then flattened into the output stream. The transformation is meant to be stateful, which is enabled by creating the transformation function mapConcaterFactory a new for every materialization — the returned function will typically close over mutable objects to store state between invocations. For the stateless variant see SelectManyTOut1, TOut2, TMat(SourceTOut1, TMat, FuncTOut1, IEnumerableTOut2). The returned Enumerable MUST NOT contain null values, as they are illegal as stream elements - according to the Reactive Streams specification.

Emits when the mapping function returns an element or there are still remaining elements from the previously calculated collection

Backpressures when downstream backpressures or there are still remaining elements from the previously calculated collection

Completes when upstream completes and all remaining elements has been emitted

Cancels when downstream cancels

See also SelectManyTOut1, TOut2, TMat(SourceTOut1, TMat, FuncTOut1, IEnumerableTOut2)
Public methodStatic memberSumTOut, TMat
Similar to AggregateTOut1, TOut2, TMat(SourceTOut1, TMat, TOut2, FuncTOut2, TOut1, TOut2) but uses first element as zero element. Applies the given function reduce towards its current and next value, yielding the next current value. 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.

Emits when upstream completes

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberTakeTOut, TMat
Terminate processing (and cancel the upstream publisher) after the given number of elements. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step. The stream will be completed without producing any elements if n is zero or negative.

Emits when the specified number of elements to take has not yet been reached

Backpressures when downstream backpressures

Completes when the defined number of elements has been taken or upstream completes

Cancels when the defined number of elements has been taken or downstream cancels
Public methodStatic memberTakeWhileTOut, TMat
Terminate processing (and cancel the upstream publisher) after predicate returns false for the first time. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step. The stream will be completed without producing any elements if predicate is false for the first stream element.

Emits when the predicate is true

Backpressures when downstream backpressures

Completes when predicate returned false or upstream completes

Cancels when predicate returned false or downstream cancels
Public methodStatic memberTakeWithinTOut, TMat
Terminate processing (and cancel the upstream publisher) after the given duration. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step. Note that this can be combined with TakeTOut, TMat(SourceTOut, TMat, Int64) to limit the number of elements within the duration.

Emits when an upstream element arrives

Backpressures when downstream backpressures

Completes when upstream completes or timer fires

Cancels when downstream cancels or timer fires
Public methodStatic memberThrottleTOut, TMat(SourceTOut, TMat, Int32, TimeSpan, Int32, ThrottleMode)
Sends elements downstream with speed limited to elements/per. In other words, this stage set the maximum rate for emitting messages. This combinator works for streams where all elements have the same cost or length. Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst). Tokens drops into the bucket at a given rate and can be "spared" for later use up to bucket capacity to allow some burstiness. Whenever stream wants to send an element, it takes as many tokens from the bucket as number of elements. If there isn't any, throttle waits until the bucket accumulates enough tokens. Parameter mode manages behaviour when upstream is faster than throttle rate:

- Shaping makes pauses before emitting messages to meet throttle rate

- Enforcing fails with exception when upstream is faster than throttle rate. Enforcing cannot emit elements that cost more than the maximumBurst

Emits when upstream emits an element and configured time per each element elapsed

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberThrottleTOut, TMat(SourceTOut, TMat, Int32, TimeSpan, Int32, FuncTOut, Int32, ThrottleMode)
Sends elements downstream with speed limited to cost/per`. Cost is calculating for each element individually by calling calculateCost function. This combinator works for streams when elements have different cost(length). Streams of ByteString for example. Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst). Tokens drops into the bucket at a given rate and can be spared for later use up to bucket capacity to allow some burstiness. Whenever stream wants to send an element, it takes as many tokens from the bucket as element cost. If there isn't any, throttle waits until the bucket accumulates enough tokens. Elements that costs more than the allowed burst will be delayed proportionally to their cost minus available tokens, meeting the target rate. Parameter mode manages behaviour when upstream is faster than throttle rate:

- Shaping makes pauses before emitting messages to meet throttle rate

- Enforcing fails with exception when upstream is faster than throttle rate. Enforcing cannot emit elements that cost more than the maximumBurst

Emits when upstream emits an element and configured time per each element elapsed

Backpressures when downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberTransformTOut1, TOut2, TMat Obsolete.
Generic transformation of a stream with a custom processing IStageTIn, TOut. This operator makes it possible to extend the Flow API when there is no specialized operator that performs the transformation.
Public methodStatic memberWatchTerminationTOut, TMat, TMat2
Materializes to TaskTResult that completes on getting termination message. The task completes with success when received complete message from upstream or cancel from downstream. It fails with the same error when received error message from downstream. It is recommended to use the internally optimized LeftTLeft, TRight(TLeft, TRight) and RightTLeft, TRight(TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberWhereTOut, TMat
Only pass on those elements that satisfy the given predicate.

Emits when the given predicate returns true for the element

Backpressures when the given predicate returns true for the element and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberWhereNotTOut, TMat
Only pass on those elements that NOT satisfy the given predicate.

Emits when the given predicate returns true for the element

Backpressures when the given predicate returns true for the element and downstream backpressures

Completes when upstream completes

Cancels when downstream cancels
Public methodStatic memberZipT1, T2, TMat
Combine the elements of current flow and the given SourceTOut, TMat into a stream of tuples.

Emits when all of the inputs has an element available

Backpressures when downstream backpressures

Completes when any upstream completes

Cancels when downstream cancels
Public methodStatic memberZipWithT1, T2, T3, TMat
Put together the elements of current flow and the given SourceTOut, TMat into a stream of combined elements using a combiner function.

Emits when all of the inputs has an element available

Backpressures when downstream backpressures

Completes when any upstream completes

Cancels when downstream cancels
Top
See Also