| SourceOperationsSplitAfterTOut, TMat Method (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
Namespace:
Akka.Streams.Dsl
Assembly:
Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax public static SubFlow<TOut, TMat, IRunnableGraph<TMat>> SplitAfter<TOut, TMat>(
this Source<TOut, TMat> flow,
SubstreamCancelStrategy substreamCancelStrategy,
Func<TOut, bool> predicate
)
[<ExtensionAttribute>]
static member SplitAfter :
flow : Source<'TOut, 'TMat> *
substreamCancelStrategy : SubstreamCancelStrategy *
predicate : Func<'TOut, bool> -> SubFlow<'TOut, 'TMat, IRunnableGraph<'TMat>>
Parameters
- flow
- Type: Akka.Streams.DslSourceTOut, TMat
TBD - substreamCancelStrategy
- Type: Akka.StreamsSubstreamCancelStrategy
TBD - predicate
- Type: SystemFuncTOut, Boolean
TBD
Type Parameters
- TOut
- TBD
- TMat
- TBD
Return Value
Type:
SubFlowTOut,
TMat,
IRunnableGraphTMatTBD
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
SourceTOut,
TMat. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also