Alias for append
If this process halts due to Cause.End
, runs p2
after this
.
If this process halts due to Cause.End
, runs p2
after this
.
Otherwise halts with whatever caused this
to Halt
.
Apply this Process
to an Iterable
.
Apply this Process
to an Iterable
.
Apply a Wye
to two Iterable
inputs.
Apply a Wye
to two Iterable
inputs.
Mostly internal use function.
Mostly internal use function. Ensures this Process
is run even
when being kill
-ed. Used to ensure resource safety in various
combinators.
Transform the left input of the given Wye
using a Process1
.
Transform the left input of the given Wye
using a Process1
.
Transform the right input of the given Wye
using a Process1
.
Transform the right input of the given Wye
using a Process1
.
Catch exceptions produced by this Process
, not including termination by Continue
, End
, Kill
and uses f
to decide whether to resume a second process.
Alias for this |> process1.awaitOption
.
Alias for this |> process1.awaitOption
.
Alias for this |> process1.buffer(n)
.
Alias for this |> process1.buffer(n)
.
Alias for this |> process1.bufferAll
.
Alias for this |> process1.bufferAll
.
Alias for this |> process1.bufferBy(f)
.
Alias for this |> process1.bufferBy(f)
.
Attached cause
when this Process terminates.
Attached cause
when this Process terminates. See Cause.causedBy
for semantics.
Alias for this |> process1.chunk(n)
.
Alias for this |> process1.chunk(n)
.
Alias for this |> process1.chunkAll
.
Alias for this |> process1.chunkAll
.
Alias for this |> process1.chunkBy(f)
.
Alias for this |> process1.chunkBy(f)
.
Alias for this |> process1.chunkBy2(f)
.
Alias for this |> process1.chunkBy2(f)
.
Alias for this |> process1.collect(pf)
.
Alias for this |> process1.collect(pf)
.
Alias for this |> process1.collectFirst(pf)
.
Alias for this |> process1.collectFirst(pf)
.
Transform the input of this Process1
.
Transform the input of this Process1
.
Transform the left input to a Wye
.
Transform the left input to a Wye
.
Transform the left input to a Tee
.
Transform the left input to a Tee
.
Transform the right input to a Wye
.
Transform the right input to a Wye
.
Transform the right input to a Tee
.
Transform the right input to a Tee
.
Alias for this |> process1.delete(f)
.
Alias for this |> process1.delete(f)
.
Converting requests for the left input into normal termination.
Converting requests for the left input into normal termination.
Note that Both
requests are rewritten to fetch from the only input.
Converting requests for the right input into normal termination.
Converting requests for the right input into normal termination.
Note that Both
requests are rewritten to fetch from the only input.
Used when a Process1
, Tee
, or Wye
is terminated by awaiting
on a branch that is in the halted state or was killed.
Used when a Process1
, Tee
, or Wye
is terminated by awaiting
on a branch that is in the halted state or was killed. Such a process
is given the opportunity to emit any final values. All Awaits are
converted to terminate with cause
Alias for this |> process1.distinctConsecutive
.
Alias for this |> process1.distinctConsecutive
.
Alias for this |> process1.distinctConsecutiveBy(f)
.
Alias for this |> process1.distinctConsecutiveBy(f)
.
Ignore all outputs of this Process
.
Alias for this |> process1.drop(n)
.
Alias for this |> process1.drop(n)
.
Alias for this |> process1.dropLast
.
Alias for this |> process1.dropLast
.
Alias for this |> process1.dropLastIf(p)
.
Alias for this |> process1.dropLastIf(p)
.
Alias for this |> process1.dropRight(n)
.
Alias for this |> process1.dropRight(n)
.
Alias for this |> process1.dropWhile(f)
.
Alias for this |> process1.dropWhile(f)
.
Non-deterministic interleave of both streams.
Non-deterministic interleave of both streams. Emits values whenever either is defined. Note this terminates after BOTH sides terminate
Map over this Process
to produce a stream of F
-actions,
then evaluate these actions.
Alias for this |> process1.exists(f)
Alias for this |> process1.exists(f)
Alias for append
Feed a single input to this Process1
.
Feed a single input to this Process1
.
Alias for this |> process1.filter(f)
.
Alias for this |> process1.filter(f)
.
Alias for this |> process1.filterBy2(f)
.
Alias for this |> process1.filterBy2(f)
.
Alias for this |> process1.find(f)
Alias for this |> process1.find(f)
Generate a Process
dynamically for each output of this Process
, and
sequence these processes using append
.
Alias for this |> process1.fold(b)(f)
.
Alias for this |> process1.fold(b)(f)
.
Alias for this |> process1.fold1(f)
.
Alias for this |> process1.fold1(f)
.
Alias for this |> process1.fold1Map(f)(M)
.
Alias for this |> process1.fold1Map(f)(M)
.
Alias for this |> process1.fold1Monoid(M)
Alias for this |> process1.fold1Monoid(M)
Alias for this |> process1.foldMap(f)(M)
.
Alias for this |> process1.foldMap(f)(M)
.
Alias for this |> process1.foldMonoid(M)
Alias for this |> process1.foldMonoid(M)
Alias for this |> process1.foldSemigroup(M)
.
Alias for this |> process1.foldSemigroup(M)
.
Alias for this |> process1.forall(f)
Alias for this |> process1.forall(f)
Produce a continuous stream from a discrete stream by using the most recent value.
Produce a continuous stream from a discrete stream by using the most recent value.
Map over this Process
to produce a stream of F
-actions,
then evaluate these actions in batches of bufSize
, allowing
for nondeterminism in the evaluation order of each action in the
batch.
Catch some of the exceptions generated by this Process
, rethrowing any
not handled by the given PartialFunction
and stripping out any values
emitted before the error.
Alternate emitting elements from this
and p2
, starting with this
.
Alternate emitting elements from this
and p2
, starting with this
.
Alias for this |> process1.intersperse(sep)
.
Alias for this |> process1.intersperse(sep)
.
Returns true, if this process is halted
Causes this process to be terminated immediately with Kill
cause,
giving chance for any cleanup actions to be run
Alias for this |> process1.last
.
Alias for this |> process1.last
.
Alias for this |> process1.last
.
Alias for this |> process1.last
.
Transform self
to operate on the left hand side of an \/
, passing
through any values it receives on the right.
Transform self
to operate on the left hand side of an \/
, passing
through any values it receives on the right. Note that this halts
whenever self
halts.
Transform self
to operate on the right hand side of an \/
, passing
through any values it receives on the left.
Transform self
to operate on the right hand side of an \/
, passing
through any values it receives on the left. Note that this halts
whenever self
halts.
Transforms the output values of this Process
using f
.
Alias for this |> process1.mapAccumulate(s)(f)
.
Alias for this |> process1.mapAccumulate(s)(f)
.
Alias for this |> process1.maximum
.
Alias for this |> process1.maximum
.
Alias for this |> process1.maximumBy(f)
.
Alias for this |> process1.maximumBy(f)
.
Alias for this |> process1.maximumOf(f)
.
Alias for this |> process1.maximumOf(f)
.
Non-deterministic interleave of both streams.
Non-deterministic interleave of both streams. Emits values whenever either is defined. Note this terminates after BOTH sides terminate
Alias for this |> process1.minimum
.
Alias for this |> process1.minimum
.
Alias for this |> process1.minimumBy(f)
.
Alias for this |> process1.minimumBy(f)
.
Alias for this |> process1.minimumOf(f)
.
Alias for this |> process1.minimumOf(f)
.
Returns result of channel evaluation on O
side tupled with
original output value passed to channel.
Returns result of channel evaluation on O
side tupled with
original output value passed to channel.
Returns result of channel evaluation tupled with original value passed to channel.
Returns result of channel evaluation tupled with original value passed to channel.
Returns result of channel evaluation on W
side tupled with
original write value passed to channel.
Returns result of channel evaluation on W
side tupled with
original write value passed to channel.
Run p2
after this Process
completes normally, or in the event of an error.
Run p2
after this Process
completes normally, or in the event of an error.
This behaves almost identically to append
, except that p1 append p2
will
not run p2
if p1
halts with an Error
or is killed. Any errors raised by
this
are reraised after p2
completes.
Note that p2
is made into a finalizer using asFinalizer
, so we
can be assured it is run even when this Process
is being killed
by a downstream consumer.
If this Process
completes with an error, call f
to produce
the next state.
If this Process
completes with an error, call f
to produce
the next state. f
is responsible for reraising the error if that
is the desired behavior. Since this function is often used for attaching
resource deallocation logic, the result of f
is made into a finalizer
using asFinalizer
, so we can be assured it is run even when this Process
is being killed by a downstream consumer.
When this Process
halts, call f
to produce the next state.
When this Process
halts, call f
to produce the next state.
Note that this function may be used to swallow or handle errors.
Attach supplied process only if process has been killed.
Attach supplied process only if process has been killed.
Since this function is often used for attaching resource
deallocation logic, the result of f
is made into a finalizer
using asFinalizer
, so we can be assured it is run even when
this Process
is being killed by a downstream consumer.
Alias for this |> Process.await1
.
Alias for this |> Process.await1
.
Like attempt
, but accepts a partial function.
Like attempt
, but accepts a partial function. Unhandled errors are rethrown.
Feed the output of this Process
as input of p1
.
Feed the output of this Process
as input of p1
. The implementation
will fuse the two processes, so this process will only generate
values as they are demanded by p1
. If p1
signals termination, this
is killed with same reason giving it an opportunity to cleanup.
converts sink to sink that first pipes received I0
to supplied p1
converts sink to sink that first pipes received I0
to supplied p1
Alias for this |> process1.prefixSums
Alias for this |> process1.prefixSums
Prepend a sequence of elements to the output of this Process
.
Alias for this |> process1.reduce(f)
.
Alias for this |> process1.reduce(f)
.
Alias for this |> process1.reduceMap(f)(M)
.
Alias for this |> process1.reduceMap(f)(M)
.
Alias for this |> process1.reduceMonoid(M)
.
Alias for this |> process1.reduceMonoid(M)
.
Alias for this |> process1.reduceSemigroup(M)
.
Alias for this |> process1.reduceSemigroup(M)
.
Alias for this |> process1.repartition(p)(S)
Alias for this |> process1.repartition(p)(S)
Alias for this |> process1.repartition2(p)(S)
Alias for this |> process1.repartition2(p)(S)
Run this process until it halts, then run it again and again, as
long as no errors or Kill
occur.
Run this Process
, purely for its effects.
Collect the outputs of this Process[F,O]
into a Monoid B
, given a Monad[F]
in
which we can catch exceptions.
Collect the outputs of this Process[F,O]
into a Monoid B
, given a Monad[F]
in
which we can catch exceptions. This function is not tail recursive and
relies on the Monad[F]
to ensure stack safety.
Run this Process
solely for its final emitted value, if one exists.
Run this Process
solely for its final emitted value, if one exists, using o2
otherwise.
Collect the outputs of this Process[F,O]
, given a Monad[F]
in
which we can catch exceptions.
Collect the outputs of this Process[F,O]
, given a Monad[F]
in
which we can catch exceptions. This function is not tail recursive and
relies on the Monad[F]
to ensure stack safety.
Alias for this |> process1.scan(b)(f)
.
Alias for this |> process1.scan(b)(f)
.
Alias for this |> process1.scan1(f)
.
Alias for this |> process1.scan1(f)
.
Alias for this |> process1.scan1Map(f)(M)
.
Alias for this |> process1.scan1Map(f)(M)
.
Alias for this |> process1.scan1Monoid(M)
.
Alias for this |> process1.scan1Monoid(M)
.
Alias for this |> process1.scanMap(f)(M)
.
Alias for this |> process1.scanMap(f)(M)
.
Alias for this |> process1.scanMonoid(M)
.
Alias for this |> process1.scanMonoid(M)
.
Alias for this |> process1.scanSemigroup(M)
.
Alias for this |> process1.scanSemigroup(M)
.
Alias for this |> process1.shiftRight(head)
Alias for this |> process1.shiftRight(head)
Delay running this Process
until awaken
becomes true for the first time.
Delay running this Process
until awaken
becomes true for the first time.
Alias for this |> process1.sliding(n)
.
Alias for this |> process1.sliding(n)
.
Alias for this |> process1.split(f)
Alias for this |> process1.split(f)
Alias for this |> process1.splitOn(p)
Alias for this |> process1.splitOn(p)
Alias for this |> process1.splitWith(f)
Alias for this |> process1.splitWith(f)
Alias for this |> process1.stateScan(init)(f)
.
Alias for this |> process1.stateScan(init)(f)
.
Run one step of an incremental traversal of this Process
.
Run one step of an incremental traversal of this Process
.
This function is mostly intended for internal use. As it allows
a Process
to be observed and captured during its execution,
users are responsible for ensuring resource safety.
Alias for this |> process1.sum
Alias for this |> process1.sum
p.suspendStep
propagates exceptions to p
.
For anly process terminating with Kill
, this swallows the Kill
and replaces it with End
termination
Alias for this |> process1.tail
.
Alias for this |> process1.tail
.
Alias for this |> process1.take(n)
.
Alias for this |> process1.take(n)
.
Alias for this |> process1.takeRight(n)
.
Alias for this |> process1.takeRight(n)
.
Alias for this |> process1.takeThrough(f)
.
Alias for this |> process1.takeThrough(f)
.
Alias for this |> process1.takeWhile(f)
.
Alias for this |> process1.takeWhile(f)
.
Use a Tee
to interleave or combine the outputs of this
and
p2
.
Use a Tee
to interleave or combine the outputs of this
and
p2
. This can be used for zipping, interleaving, and so forth.
Nothing requires that the Tee
read elements from each
Process
in lockstep. It could read fifty elements from one
side, then two elements from the other, then combine or
interleave these values in some way, etc.
If at any point the Tee
awaits on a side that has halted,
we gracefully kill off the other side, then halt.
If at any point t
terminates with cause c
, both sides are killed, and
the resulting Process
terminates with c
.
Alias for this |> process1.terminated
.
Alias for this |> process1.terminated
.
Feed this Writer
's output through the provided effectful Channel
.
Feed this Writer
's output through the provided effectful Channel
.
Feed this Writer
's writes through the provided effectful Channel
.
Feed this Writer
's writes through the provided effectful Channel
.
converts process to signal *
converts process to signal *
Translate the request type from F
to G
, using the given polymorphic function.
Remove any leading emitted values from this Process
.
Remove any leading emitted values from this Process
.
Removes all emitted elements from the front of this Process
.
Removes all emitted elements from the front of this Process
.
The second argument returned by this method is guaranteed to be
an Await
, Halt
or an Append
-- if there are multiple Emit'
s at the
front of this process, the sequences are concatenated together.
If this Process
does not begin with an Emit
, returns the empty
sequence along with this
.
Halts this Process
as soon as condition
becomes true
.
Halts this Process
as soon as condition
becomes true
. Note that condition
is checked before each and every read from this
, so condition
should return
very quickly or be continuous to avoid holding up the output Process
. Use
condition.forwardFill
to convert an infrequent discrete Process
to a
continuous one for use with this function.
When condition
is true
, lets through any values in this
process, otherwise blocks
until condition
becomes true again.
When condition
is true
, lets through any values in this
process, otherwise blocks
until condition
becomes true again. Note that the condition
is checked before
each and every read from this
, so condition
should return very quickly or be
continuous to avoid holding up the output Process
. Use condition.forwardFill
to
convert an infrequent discrete Process
to a continuous one for use with this
function.
Like tee
, but we allow the Wye
to read non-deterministically
from both sides at once.
Like tee
, but we allow the Wye
to read non-deterministically
from both sides at once.
If y
is in the state of awaiting Both
, this implementation
will continue feeding y
from either left or right side,
until either it halts or _both_ sides halt.
If y
is in the state of awaiting L
, and the left
input has halted, we halt. Likewise for the right side.
For as long as y
permits it, this implementation will _always_
feed it any leading Emit
elements from either side before issuing
new F
requests. More sophisticated chunking and fairness
policies do not belong here, but should be built into the Wye
and/or its inputs.
The strategy passed in must be stack-safe, otherwise this implementation
will throw SOE. Preferably use one of the Strategys.Executor(es)
based strategies
Non-deterministic version of zip
.
Non-deterministic version of zip
. Note this terminates whenever one of streams terminate
Non-deterministic version of zipWith
.
Non-deterministic version of zipWith
. Note this terminates whenever one of streams terminate
Call tee
with the zip
Tee[O,O2,O3]
defined in tee.scala
.
Call tee
with the zip
Tee[O,O2,O3]
defined in tee.scala
.
Call tee
with the zipWith
Tee[O,O2,O3]
defined in tee.scala
.
Call tee
with the zipWith
Tee[O,O2,O3]
defined in tee.scala
.
Alias for this |> process1.zipWithIndex[A,N]*
.
Alias for this |> process1.zipWithIndex[A,N]*
.
Alias for this |> process1.zipWithIndex[A]*
.
Alias for this |> process1.zipWithIndex[A]*
.
Alias for this |> process1.zipWithNext
.
Alias for this |> process1.zipWithNext
.
Alias for this |> process1.zipWithPrevious
.
Alias for this |> process1.zipWithPrevious
.
Alias for this |> process1.zipWithPreviousAndNext
.
Alias for this |> process1.zipWithPreviousAndNext
.
Alias for this |> process1.zipWithScan(z)(next)
.
Alias for this |> process1.zipWithScan(z)(next)
.
Alias for this |> process1.zipWithScan(z)(next)
.
Alias for this |> process1.zipWithScan(z)(next)
.
Alias for this |> process1.zipWithState(z)(next)
.
Alias for this |> process1.zipWithState(z)(next)
.
Operator alias for pipe
.
(process: SourceSyntax[O]).self
(process: Process1Syntax[Any, O]).self
(process: WyeSyntax[Any, Any, O]).self
(process: WriterTaskSyntax[W, O]).self
(process: TeeSyntax[Any, Any, O]).self
(process: SinkTaskSyntax[Any]).self
An effectful stream of
O
values. In between emitting values aProcess
may request evaluation ofF
effects. AProcess[Nothing,A]
is a pureProcess
with no effects. AProcess[Task,A]
may haveTask
effects. AProcess
halts due to someCause
, generallyEnd
(indicating normal termination) orError(t)
for somet: Throwable
indicating abnormal termination due to some uncaught error.