Class Flow<TIn, TOut, TMat>
A Flow<TIn, TOut, TMat> is a set of stream processing steps that has one open input and one open output.
Inherited Members
Namespace: Akka.Streams.Dsl
Assembly: Akka.Streams.dll
Syntax
public sealed class Flow<TIn, TOut, TMat> : IFlow<TOut, TMat>, IGraph<FlowShape<TIn, TOut>, TMat>, IGraph<FlowShape<TIn, TOut>>
Type Parameters
| Name | Description |
|---|---|
| TIn | Type of the flow input. |
| TOut | Type of the flow output. |
| TMat | Type of value, flow graph may materialize to. |
Properties
| Edit this page View SourceModule
TBD
Declaration
public IModule Module { get; }
Property Value
| Type | Description |
|---|---|
| IModule |
Shape
TBD
Declaration
public FlowShape<TIn, TOut> Shape { get; }
Property Value
| Type | Description |
|---|---|
| FlowShape<TIn, TOut> |
Methods
| Edit this page View SourceAddAttributes(Attributes)
Add the given attributes to this Flow<TIn, TOut, TMat>. Further calls to WithAttributes(Attributes) will not remove these attributes. Note that this operation has no effect on an empty Flow (because the attributes apply only to the contained processing stages).
Declaration
public Flow<TIn, TOut, TMat> AddAttributes(Attributes attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat> | TBD |
Ask<TOut2>(IActorRef, TimeSpan, int)
Use the ask pattern to send a request-reply message to the target actorRef.
If any of the asks times out it will fail the stream with a AskTimeoutException.
Parallelism limits the number of how many asks can be "in flight" at the same time. Please note that the elements emitted by this operator are in-order with regards to the asks being issued (i.e. same behaviour as SelectAsync<TIn, TOut, TMat>(Source<TIn, TMat>, int, Func<TIn, Task<TOut>>)).
The operator fails with an WatchedActorTerminatedException if the target actor is terminated, or with an TimeoutException in case the ask exceeds the timeout passed in.
Adheres to the ActorAttributes.SupervisionStrategy attribute.
'''Emits when''' the futures (in submission order) created by the ask pattern internally are completed. '''Backpressures when''' the number of futures reaches the configured parallelism and the downstream backpressures. '''Completes when''' upstream completes and all futures have been completed and all elements have been emitted. '''Fails when''' the passed in actor terminates, or a timeout is exceeded in any of the asks performed. '''Cancels when''' downstream cancels.
Declaration
public Flow<TIn, TOut2, TMat> Ask<TOut2>(IActorRef actorRef, TimeSpan timeout, int parallelism = 2)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | actorRef | |
| TimeSpan | timeout | |
| int | parallelism |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut2, TMat> |
Type Parameters
| Name | Description |
|---|---|
| TOut2 |
Async()
Put an asynchronous boundary around this Source.
Declaration
public Flow<TIn, TOut, TMat> Async()
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat> | TBD |
ConcatMaterialized<TMat2, TMat3>(IGraph<SourceShape<TOut>, TMat2>, Func<TMat, TMat2, TMat3>)
Concatenate the given Source<TOut, TMat> to this Flow<TIn, 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 Flow and just kept from producing elements by asserting back-pressure until its time comes.
If this Flow<TIn, TOut, TMat> gets upstream error - no elements from the given Source<TOut, TMat> will be pulled.
@see Concat<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.
Declaration
public Flow<TIn, TOut, TMat3> ConcatMaterialized<TMat2, TMat3>(IGraph<SourceShape<TOut>, TMat2> that, Func<TMat, TMat2, TMat3> materializedFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<SourceShape<TOut>, TMat2> | that | TBD |
| Func<TMat, TMat2, TMat3> | materializedFunction | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat3> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat2 | TBD |
| TMat3 | TBD |
JoinMaterialized<TMat2, TMat3>(IGraph<FlowShape<TOut, TIn>, TMat2>, Func<TMat, TMat2, TMat3>)
Join this Flow<TIn, TOut, TMat> to another Flow<TIn, TOut, TMat>, by cross connecting the inputs and outputs, creating a IRunnableGraph<TMat>
The combine function is used to compose the materialized values of this flow and that
Flow into the materialized value of the resulting Flow.
Declaration
public IRunnableGraph<TMat3> JoinMaterialized<TMat2, TMat3>(IGraph<FlowShape<TOut, TIn>, TMat2> flow, Func<TMat, TMat2, TMat3> combine)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<FlowShape<TOut, TIn>, TMat2> | flow | TBD |
| Func<TMat, TMat2, TMat3> | combine | TBD |
Returns
| Type | Description |
|---|---|
| IRunnableGraph<TMat3> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat2 | TBD |
| TMat3 | TBD |
JoinMaterialized<TIn2, TOut2, TMat2, TMatRes>(IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2>, Func<TMat, TMat2, TMatRes>)
TBD
Declaration
public Flow<TIn2, TOut2, TMatRes> JoinMaterialized<TIn2, TOut2, TMat2, TMatRes>(IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2> bidi, Func<TMat, TMat2, TMatRes> combine)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2> | bidi | TBD |
| Func<TMat, TMat2, TMatRes> | combine | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn2, TOut2, TMatRes> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TIn2 | TBD |
| TOut2 | TBD |
| TMat2 | TBD |
| TMatRes | TBD |
Join<TMat2>(IGraph<FlowShape<TOut, TIn>, TMat2>)
Join this Flow<TIn, TOut, TMat> to another Flow<TIn, TOut, TMat>, by cross connecting the inputs and outputs, creating a IRunnableGraph<TMat>. The materialized value of the combined Flow<TIn, TOut, TMat> will be the materialized value of the current flow (ignoring the other Flow’s value), use JoinMaterialized<TMat2, TMat3>(IGraph<FlowShape<TOut, TIn>, TMat2>, Func<TMat, TMat2, TMat3>) if a different strategy is needed.
Declaration
public IRunnableGraph<TMat> Join<TMat2>(IGraph<FlowShape<TOut, TIn>, TMat2> flow)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<FlowShape<TOut, TIn>, TMat2> | flow | TBD |
Returns
| Type | Description |
|---|---|
| IRunnableGraph<TMat> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat2 | TBD |
Join<TIn2, TOut2, TMat2>(IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2>)
TBD
Declaration
public Flow<TIn2, TOut2, TMat> Join<TIn2, TOut2, TMat2>(IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2> bidi)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<BidiShape<TOut, TOut2, TIn2, TIn>, TMat2> | bidi | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn2, TOut2, TMat> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TIn2 | TBD |
| TOut2 | TBD |
| TMat2 | TBD |
MapMaterializedValue<TMat2>(Func<TMat, TMat2>)
Transform the materialized value of this Flow, leaving all other properties as they were.
Declaration
public Flow<TIn, TOut, TMat2> MapMaterializedValue<TMat2>(Func<TMat, TMat2> mapFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TMat, TMat2> | mapFunc | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat2> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat2 | TBD |
Named(string)
Add a name attribute to this Flow.
Declaration
public Flow<TIn, TOut, TMat> Named(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat> | TBD |
RunWith<TMat1, TMat2>(IGraph<SourceShape<TIn>, TMat1>, IGraph<SinkShape<TOut>, TMat2>, IMaterializer)
Connect the Source<TOut, TMat> to this Flow<TIn, TOut, TMat> and then connect it to the Sink<TIn, TMat> and run it.
The returned tuple contains the materialized values of the source and sink, e.g. the Reactive.Streams.ISubscriber<T>
of a AsSubscriber<T>() and Reactive.Streams.IPublisher<T> of a Publisher<TIn>().
Declaration
public (TMat1, TMat2) RunWith<TMat1, TMat2>(IGraph<SourceShape<TIn>, TMat1> source, IGraph<SinkShape<TOut>, TMat2> sink, IMaterializer materializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<SourceShape<TIn>, TMat1> | source | TBD |
| IGraph<SinkShape<TOut>, TMat2> | sink | TBD |
| IMaterializer | materializer | TBD |
Returns
| Type | Description |
|---|---|
| (TMat1, TMat2) | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat1 | TBD |
| TMat2 | TBD |
ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<TOut>, TMat2>, Func<TMat, TMat2, TMat3>)
Connect this Flow<TIn, TOut, TMat> to a Sink<TIn, TMat>, concatenating the processing steps of both.
The combine function is used to compose the materialized values of this flow and that
Sink into the materialized value of the resulting Sink.
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.
Declaration
public Sink<TIn, TMat3> ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<TOut>, TMat2> sink, Func<TMat, TMat2, TMat3> combine)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<SinkShape<TOut>, TMat2> | sink | TBD |
| Func<TMat, TMat2, TMat3> | combine | TBD |
Returns
| Type | Description |
|---|---|
| Sink<TIn, TMat3> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TMat2 | TBD |
| TMat3 | TBD |
ToProcessor()
Converts this Flow to a IRunnableGraph<TMat> that materializes to a Reactive Streams Reactive.Streams.IProcessor<T1, T2> which implements the operations encapsulated by this Flow. Every materialization results in a new Processor instance, i.e. the returned IRunnableGraph<TMat> is reusable.
Declaration
public IRunnableGraph<IProcessor<TIn, TOut>> ToProcessor()
Returns
| Type | Description |
|---|---|
| IRunnableGraph<IProcessor<TIn, TOut>> | A IRunnableGraph<TMat> that materializes to a Reactive.Streams.IProcessor<T1, T2> when Run() is called on it. |
ToString()
TBD
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | TBD |
Overrides
| Edit this page View SourceTo<TMat2>(IGraph<SinkShape<TOut>, TMat2>)
Connect this Flow<TIn, TOut, TMat> to a Sink<TIn, TMat>, concatenating the processing steps of both. The materialized value of the combined Sink<TIn, TMat> will be the materialized value of the current flow (ignoring the given Sink’s value), use ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<TOut>, TMat2>, Func<TMat, TMat2, TMat3>) if a different strategy is needed.
Declaration
public Sink<TIn, TMat> To<TMat2>(IGraph<SinkShape<TOut>, TMat2> sink)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<SinkShape<TOut>, TMat2> | sink |
Returns
| Type | Description |
|---|---|
| Sink<TIn, TMat> |
Type Parameters
| Name | Description |
|---|---|
| TMat2 |
ViaMaterialized<TOut2, TMat2, TMat3>(IGraph<FlowShape<TOut, TOut2>, TMat2>, Func<TMat, TMat2, TMat3>)
Transform this Flow<TIn, TOut, TMat> by appending the given processing steps.
The combine function is used to compose the materialized values of this flow and that
flow into the materialized value of the resulting Flow.
Declaration
public Flow<TIn, TOut2, TMat3> ViaMaterialized<TOut2, TMat2, TMat3>(IGraph<FlowShape<TOut, TOut2>, TMat2> flow, Func<TMat, TMat2, TMat3> combine)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<FlowShape<TOut, TOut2>, TMat2> | flow | TBD |
| Func<TMat, TMat2, TMat3> | combine | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut2, TMat3> | TBD |
Type Parameters
| Name | Description |
|---|---|
| TOut2 | TBD |
| TMat2 | TBD |
| TMat3 | TBD |
Via<T2, TMat2>(IGraph<FlowShape<TOut, T2>, TMat2>)
Transform this Flow<TIn, TOut, TMat> by appending the given processing steps. The materialized value of the combined Flow<TIn, TOut, TMat> will be the materialized value of the current flow (ignoring the other flow’s value), use ViaMaterialized<TOut2, TMat2, TMat3>(IGraph<FlowShape<TOut, TOut2>, TMat2>, Func<TMat, TMat2, TMat3>) if a different strategy is needed.
Declaration
public Flow<TIn, T2, TMat> Via<T2, TMat2>(IGraph<FlowShape<TOut, T2>, TMat2> flow)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph<FlowShape<TOut, T2>, TMat2> | flow | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, T2, TMat> | TBD |
Type Parameters
| Name | Description |
|---|---|
| T2 | TBD |
| TMat2 | TBD |
WithAttributes(Attributes)
Change the attributes of this Flow<TIn, TOut, TMat> to the given ones. Note that this operation has no effect on an empty Flow (because the attributes apply only to the contained processing stages).
Declaration
public Flow<TIn, TOut, TMat> WithAttributes(Attributes attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Attributes | attributes | TBD |
Returns
| Type | Description |
|---|---|
| Flow<TIn, TOut, TMat> | TBD |
Edit this page