Click or drag to resize
Akka.NETSubFlowOperations Methods

The SubFlowOperations type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAggregate<TOut1, TOut2, TMat, TClosed>
Similar to Scan< TOut1, TOut2, TMat, TClosed> (SubFlow< TOut1, TMat, TClosed> , TOut2, Func< TOut2, 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 memberAggregateAsync<TIn, TOut, TMat, TClosed>
Similar to Aggregate< TOut1, TOut2, TMat, TClosed> (SubFlow< TOut1, TMat, TClosed> , TOut2, Func< TOut2, 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 memberAlsoTo<TOut, TMat, TClosed>
Attaches the given to this IFlow<TOut, 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 memberAlsoToMaterialized<TOut, TMat, TMat2, TMat3, TClosed>
Attaches the given to this IFlow<TOut, 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 memberBackpressureTimeout<TOut, TMat, TClosed>
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 memberBatch<TOut, TOut2, TMat, TClosed>
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 memberBatchWeighted<TOut, TOut2, TMat, TClosed>
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 memberBuffer<TOut, TMat, TClosed>
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 memberCollect<TOut1, TOut2, TMat, TClosed>
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 memberCompletionTimeout<TOut, TMat, TClosed>
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 memberConcat<TOut, TMat, TClosed>
Concatenate the given Source< TOut, TMat> to this IFlow<TOut, 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 Source< TOut, TMat> is materialized together with this IFlow< TOut, TMat> and just kept from producing elements by asserting back-pressure until its time comes. If this IFlow< TOut, TMat> gets upstream error - no elements from the given Source< TOut, TMat> will be pulled.

Emits when element is available from current stream or from the given Source< TOut, TMat> when current is completed

Backpressures when downstream backpressures

Completes when given Source< TOut, TMat> completes

Cancels when downstream cancels
Public methodStatic memberConcatMany<TOut1, TOut2, TMat, TClosed>
Transform each input element into a Source< TOut, 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 memberConflate<TOut, TMat, TClosed>
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 ConflateWithSeed< TOut, TMat, TSeed, TClosed> (SubFlow< TOut, TMat, TClosed> , Func< TOut, TSeed> , Func< TSeed, 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 memberConflateWithSeed<TOut, TMat, TSeed, TClosed>
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 Conflate< TOut, TMat, TClosed> (SubFlow< TOut, TMat, TClosed> , Func< TOut, 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 memberDelay<TOut, TMat, TClosed>
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 memberDetach<TOut, TMat, TClosed>
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 memberExpand<TOut1, TOut2, TMat, TClosed>
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 memberGrouped<TOut, TMat, TClosed>
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 memberGroupedWithin<TOut, TMat, TClosed>
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 memberIdleTimeout<TOut, TMat, TClosed>
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 memberInitialDelay<TOut, TMat, TClosed>
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 memberInitialTimeout<TOut, TMat, TClosed>
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 exampleInterleave<T1, T2, TMat, TClosed>
Interleave is a deterministic merge of the given Source< TOut, TMat> with elements of this IFlow<TOut, 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 IFlow< TOut, TMat> and given Source< TOut, TMat> completes

Cancels when downstream cancels
Public methodStatic memberInterleaveMaterialized<T1, T2, TMat, TMat2, TMat3, TClosed>
Interleave is a deterministic merge of the given Source< TOut, TMat> with elements of this IFlow<TOut, TMat>. It first emits segmentSize number of elements from this flow to downstream, then - same amount for graph 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. @seeInterleave<TIn, TOut>. It is recommended to use the internally optimized Left< TLeft, TRight> (TLeft, TRight) and Right< TLeft, TRight> (TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberIntersperse<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, 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 Concat< TIn, TOut> 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 memberIntersperse<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, 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 Concat< TIn, TOut> 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 memberKeepAlive<TOut, TInjected, TMat, TClosed>
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 memberLimit<T, TMat, TClosed>
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 memberLimitWeighted<T, TMat, TClosed>
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 memberLog<TOut, TMat, TClosed>
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 Attributes. LogLevels 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 memberMerge<TOut1, TOut2, TMat, TClosed>
Merge the given Source< TOut, TMat> to this IFlow<TOut, 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 memberMergeMany<TOut1, TOut2, TMat, TClosed>
Transform each input element into a Source< TOut, 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 memberMergeMaterialized<TOut1, TOut2, TMat, TMat2, TMat3, TClosed>
Merge the given Source< TOut, TMat> to this IFlow<TOut, TMat>, taking elements as they arrive from input streams, picking randomly when several elements ready. @see Merge< TOut1, TOut2, TMat, TClosed> (SubFlow< TOut1, TMat, TClosed> , IGraph< SourceShape< TOut2> , TMat> , Boolean) It is recommended to use the internally optimized Left< TLeft, TRight> (TLeft, TRight) and Right< TLeft, TRight> (TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberMergeSorted<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, IGraph<SourceShape<TOut>, TMat>)
Merge the given Source< TOut, TMat> to this IFlow<TOut, 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 memberMergeSorted<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, IGraph<SourceShape<TOut>, TMat>, IComparer<TOut>)
Merge the given Source< TOut, TMat> to this IFlow<TOut, 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 memberMergeSorted<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, IGraph<SourceShape<TOut>, TMat>, Func<TOut, TOut, Int32>)
Merge the given Source< TOut, TMat> to this IFlow<TOut, 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 memberOrElse<T, TMat, TClosed>
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 Source< TOut, 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 memberPrefixAndTail<TOut, TMat, TClosed>
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 memberPrepend<TOut1, TOut2, TMat, TClosed>
Prepend the given Source< TOut, TMat> to this IFlow<TOut, TMat>, meaning that before elements are generated from this IFlow<TOut, TMat>, the Source's elements will be produced until it is exhausted, at which point Flow elements will start being produced. Note that this IFlow< TOut, TMat> will be materialized together with the Source< TOut, TMat> and just kept from producing elements by asserting back-pressure until its time comes. If the given Source< TOut, TMat> gets upstream error - no elements from this IFlow< TOut, TMat> will be pulled. Emits when element is available from the given Source< TOut, TMat> or from current stream when the Source< TOut, TMat> is completed Backpressures when downstream backpressures Completes when this IFlow< TOut, TMat> completes Cancels when downstream cancels
Public methodStatic memberRecover<TOut, TMat, TClosed>
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 memberRecoverWith<TOut, TMat, TClosed> 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 memberRecoverWithRetries<TOut, TMat, TClosed>
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 RecoverWithRetries<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, Func<Exception, IGraph<SourceShape<TOut>, 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 memberScan<TOut1, TOut2, TMat, TClosed>
Similar to Aggregate< TOut1, TOut2, TMat, TClosed> (SubFlow< TOut1, TMat, TClosed> , TOut2, Func< TOut2, 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 memberSelect<TIn, TOut, TMat, TClosed>
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 memberSelectAsync<TIn, TOut, TMat, TClosed>
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< TResult> 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 SelectAsync<TIn, TOut, TMat, TClosed>(SubFlow<TIn, TMat, TClosed>, Int32, Func<TIn, Task<TOut>>). 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 memberSelectAsyncUnordered<TIn, TOut, TMat, TClosed>
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 downstream 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 memberSelectMany<TOut1, TOut2, TMat, TClosed>
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 memberSkip<TOut, TMat, TClosed>
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 memberSkipWhile<TOut, TMat, TClosed>
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 memberSkipWithin<TOut, TMat, TClosed>
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 memberSliding<TOut, TMat, TClosed>
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 memberStatefulSelectMany<TOut1, TOut2, TMat, TClosed>
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 SelectMany<TOut1, TOut2, TMat, TClosed>(SubFlow<TOut1, TMat, TClosed>, Func<TOut1, IEnumerable<TOut2>>). 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 SelectMany<TOut1, TOut2, TMat, TClosed>(SubFlow<TOut1, TMat, TClosed>, Func<TOut1, IEnumerable<TOut2>>)
Public methodStatic memberSum<TOut, TMat, TClosed>
Similar to Aggregate< TOut1, TOut2, TMat, TClosed> (SubFlow< TOut1, TMat, TClosed> , TOut2, Func< TOut2, 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 memberTake<TOut, TMat, TClosed>
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 memberTakeWhile<TOut, TMat, TClosed>
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 memberTakeWithin<TOut, TMat, TClosed>
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 Take< TOut, TMat, TClosed> (SubFlow< TOut, TMat, TClosed> , 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 memberThrottle<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, 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 memberThrottle<TOut, TMat, TClosed>(SubFlow<TOut, TMat, TClosed>, Int32, TimeSpan, Int32, Func<TOut, 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 memberTransform<TOut1, TOut2, TMat, TClosed> Obsolete.
Generic transformation of a stream with a custom processing IStage<TIn, TOut>. This operator makes it possible to extend the Flow API when there is no specialized operator that performs the transformation.
Public methodStatic memberWatchTermination<TOut, TMat, TMat2, TClosed>
Materializes to Task< TResult> 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 Left< TLeft, TRight> (TLeft, TRight) and Right< TLeft, TRight> (TLeft, TRight) combiners where appropriate instead of manually writing functions that pass through one of the values.
Public methodStatic memberWhere<TOut, TMat, TClosed>
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 memberWhereNot<TOut, TMat, TClosed>
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 memberZip<T1, T2, TMat, TClosed>
Combine the elements of current flow and the given Source< TOut, 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 memberZipWith<T1, T2, T3, TMat, TClosed>
Put together the elements of current flow and the given Source< TOut, 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