The Append
constructor instructs the driver to continue with
evaluation of first step found in tail Vector.
The Await
constructor instructs the driver to evaluate
req
.
Adds syntax for Channel
.
Continuation of the process.
The Emit
constructor instructs the driver to emit
the given sequence of values to the output
and then halt execution with supplied reason.
Marker trait representing process in Emit or Await state.
Provides infix syntax for eval: Process[F,F[O]] => Process[F,O]
The Halt
constructor instructs the driver
that the last evaluation of Process completed with
supplied cause.
Tags a state of process that has no appended tail, tha means can be Halt, Emit or Await
Marker trait representing next step of process or terminated process in Halt
This class provides infix syntax specific to Process0
.
This class provides infix syntax specific to Process1
.
Adds syntax for Sink
.
Syntax for Sink, that is specialized for Task
Syntax for processes that have its effects wrapped in Task
Intermediate step of process.
This class provides infix syntax specific to Tee
.
Infix syntax for working with Writer[F,W,O]
.
This class provides infix syntax specific to Wye
.
Alias for emitAll
Await the given F
request and use its result.
Await the given F
request and use its result.
If you need to specify fallback, use awaitOr
The Process1
which awaits a single input, emits it, then halts normally.
Like await1
, but consults fb
when await fails to receive an I
Writer
based version of await1
.
The Wye
which request from both branches concurrently.
Writer
based version of awaitBoth
.
The Tee
which requests from the left branch, emits this value, then halts.
Writer
based version of awaitL
.
Await a request, and if it fails, use fb
to determine the next state.
Await a request, and if it fails, use fb
to determine the next state.
Otherwise, use rcv
to determine the next state.
The Tee
which requests from the right branch, emits this value, then halts.
Writer
based version of awaitR
.
The infinite Process
, always emits a
.
The infinite Process
, always emits a
.
If for performance reasons it is good to emit a
in chunks,
specify size of chunk by chunkSize
parameter
The Process
which emits the single value given, then halts.
The Process
which emits the given sequence of values, then halts.
A Writer
which emits one value to the output.
A Writer
which writes the given value.
Alias for halt
.
Evaluate an arbitrary effect in a Process
.
Evaluate an arbitrary effect in a Process
. The resulting
Process
emits a single value. To evaluate repeatedly, use
repeatEval(t)
.
Do not use eval.repeat
or repeat(eval)
as that may cause infinite loop in certain situations.
Evaluate an arbitrary effect once, purely for its effects, ignoring its return value.
Evaluate an arbitrary effect once, purely for its effects,
ignoring its return value. This Process
emits no values.
The Process
which emits no values and halts immediately with the given exception.
A Process
which emits n
repetitions of a
.
Produce a continuous stream from a discrete stream by using the most recent value.
The Process
which emits no values and signals normal termination.
An infinite Process
that repeatedly applies a given function
to a start value.
An infinite Process
that repeatedly applies a given function
to a start value. start
is the first value emitted, followed
by f(start)
, then f(f(start))
, and so on.
Like iterate, but takes an effectful function for producing the next state.
Like iterate, but takes an effectful function for producing
the next state. start
is the first value emitted.
Lazily produce the range [start, stopExclusive)
.
Lazily produce the range [start, stopExclusive)
. If you want to produce the sequence in one chunk, instead of lazily, use emitAll(start until stopExclusive)
.
Lazily produce a sequence of nonoverlapping ranges, where each range
contains size
integers, assuming the upper bound is exclusive.
Lazily produce a sequence of nonoverlapping ranges, where each range
contains size
integers, assuming the upper bound is exclusive.
Example: ranges(0, 1000, 10)
results in the pairs
(0, 10), (10, 20), (20, 30) ... (990, 1000)
Note: The last emitted range may be truncated at stopExclusive
. For
instance, ranges(0,5,4)
results in (0,4), (4,5)
.
if size
<= 0
The Process1
which awaits a single input and passes it to rcv
to
determine the next state.
Like receive1
, but consults fb
when it fails to receive an input.
Prefix syntax for p.repeat
.
Evaluate an arbitrary effect in a Process
.
Evaluate an arbitrary effect in a Process
. The resulting Process
will emit values
until evaluation of f
signals termination with End
or an error occurs.
Note that if f
results to failure of type Terminated
the repeatEval will convert cause
to respective process cause termination, and will halt with that cause.
Delay running p
until awaken
becomes true for the first time.
Delay running p
until awaken
becomes true for the first time.
The awaken
process may be discrete.
A supply of Long
values, starting with initial
.
A supply of Long
values, starting with initial
.
Each read is guaranteed to return a value which is unique
across all threads reading from this supply
.
Produce p
lazily.
Produce p
lazily. Useful if producing the process involves allocation of
some local mutable resource we want to ensure is freshly allocated
for each consumer of p
.
Note that this implementation assures that:
suspend(p).kill === suspend(p.kill) suspend(p).kill === p.kill suspend(p).repeat === suspend(p.repeat) suspend(p).repeat === p.repeat suspend(p).eval === suspend(p.eval) suspend(p).eval === p.eval Halt(cause) ++ suspend(p) === Halt(cause) ++ p
A Writer
which writes the given value; alias for emitW
.
Produce a (potentially infinite) source from an unfold.
Like unfold, but takes an effectful function.