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.
Await a single value, returning None if the input has been exhausted.
Await a single value, returning None if the input has been exhausted.
A Wye which emits values from its right branch, but allows up to n
elements from the left branch to enqueue unanswered before blocking
on the right branch.
A Wye which emits values from its right branch, but allows up to n
elements from the left branch to enqueue unanswered before blocking
on the right branch.
Behaves like the identity process, but requests n elements at a time from its input.
Behaves like the identity process, but requests n elements at a time from its input.
Behaves like the identity process, but batches all output into a single Emit.
Behaves like the identity process, but batches all output into a single Emit.
Behaves like the identity process, but requests elements from its input in blocks that end whenever the predicate switches from true to false.
Behaves like the identity process, but requests elements from its input in blocks that end whenever the predicate switches from true to false.
Implementation of resource for channels where resource needs to be flushed at the end of processing.
Implementation of resource for channels where resource needs to be flushed at the end of processing.
Like resource, but the release action may emit a final value,
useful for flushing any internal buffers.
Like resource, but the release action may emit a final value,
useful for flushing any internal buffers. NB: In the event of an
error, this final value is ignored.
Promote an effectful function to a Channel.
Promote an effectful function to a Channel.
Groups inputs into chunks of size n.
Groups inputs into chunks of size n. The last chunk may have size
less then n, depending on the number of elements in the input.
Collects up all output of this Process1 into a single Emit.
Collects up all output of this Process1 into a single Emit.
Like chunk, but emits a chunk whenever the predicate switches from
true to false.
Like chunk, but emits a chunk whenever the predicate switches from
true to false.
Create a Channel[Task,Int,Bytes] from an InputStream by
repeatedly requesting the given number of bytes.
Create a Channel[Task,Int,Bytes] from an InputStream by
repeatedly requesting the given number of bytes. The last chunk
may be less than the requested size.
This implementation requires an array allocation for each read.
To recycle the input buffer, use unsafeChunkR.
This implementation closes the InputStream when finished
or in the event of an error.
Create a Sink from an OutputStream, which will be closed
when this Process is halted.
Create a Sink from an OutputStream, which will be closed
when this Process is halted.
Like collect on scala collection.
Like collect on scala collection.
Builds a new process by applying a partial function
to all elements of this process on which the function is defined.
Elements, for which the partial function is not defined are filtered out from new process
A Wye which echoes the right branch while draining the left,
taking care to make sure that the left branch is never more
than maxUnacknowledged behind the right.
A Wye which echoes the right branch while draining the left,
taking care to make sure that the left branch is never more
than maxUnacknowledged behind the right. For example:
src.connect(snk)(observe(10)) will output the the same thing
as src, but will as a side effect direct output to snk,
blocking on snk if more than 10 elements have enqueued
without a response.
A Wye which echoes the left branch while draining the right,
taking care to make sure that the right branch is never more
than maxUnacknowledged behind the left.
A Wye which echoes the left branch while draining the right,
taking care to make sure that the right branch is never more
than maxUnacknowledged behind the left. For example:
src.connect(snk)(observe(10)) will output the the same thing
as src, but will as a side effect direct output to snk,
blocking on snk if more than 10 elements have enqueued
without a response.
Skips the first n elements of the input, then passes through the rest.
Skips the first n elements of the input, then passes through the rest.
Skips elements of the input while the predicate is true, then passes through the remaining inputs.
Skips elements of the input while the predicate is true, then passes through the remaining inputs.
After each input, dynamically determine whether to read from the left, right, or both,
for the subsequent input, using the provided functions f and g.
After each input, dynamically determine whether to read from the left, right, or both,
for the subsequent input, using the provided functions f and g. The returned
Wye begins by reading from the left side and is left-biased--if a read of both branches
returns a These(x,y), it uses the signal generated by f for its next step.
Invokes dynamic with I == I2, and produces a single I output.
Invokes dynamic with I == I2, and produces a single I output. Output is
left-biased: if a These(i1,i2) is emitted, this is translated to an
emitSeq(List(i1,i2)).
Nondeterminstic interleave of both inputs.
Nondeterminstic interleave of both inputs. Emits values whenever either of the inputs is available.
Feed a sequence of inputs to a Process1.
Feed a sequence of inputs to a Process1.
Feed a single These value to a Wye.
Feed a single These value to a Wye.
Feed a single input to a Process1.
Feed a single input to a Process1.
Feed a value to both the right and left branch of a Wye.
Feed a value to both the right and left branch of a Wye.
Feed a single value to the left branch of a Wye.
Feed a single value to the left branch of a Wye.
Feed a single value to the right branch of a Wye.
Feed a single value to the right branch of a Wye.
Feed a sequence of values to the left branch of a Wye.
Feed a sequence of values to the left branch of a Wye.
Feed a sequence of values to the right branch of a Wye.
Feed a sequence of values to the right branch of a Wye.
Create a Source from a file name and optional buffer size in bytes.
Create a Source from a file name and optional buffer size in bytes.
Create a Sink from a file name and optional buffer size in bytes.
Create a Sink from a file name and optional buffer size in bytes.
A Sink which, as a side effect, adds elements to the given Buffer.
A Sink which, as a side effect, adds elements to the given Buffer.
Skips any elements of the input not matching the predicate.
Skips any elements of the input not matching the predicate.
Skips any elements not satisfying predicate and when found, will emit that element and terminate
Skips any elements not satisfying predicate and when found, will emit that element and terminate
Convert right requests to left requests and vice versa.
Convert right requests to left requests and vice versa.
Process1 form of List.fold.
Process1 form of List.fold.
Folds the elements of this Process using the specified associative binary operator.
Unlike List.fold the order is always from the left side, i.e. it will always
honor order of A.
If Process of A is empty, it will just emit z and terminate
Process(1,2,3,4) |> fold(0)(_ + _) == Process(10)
Process1 form of List.reduce.
Process1 form of List.reduce.
Reduces the elements of this Process using the specified associative binary operator.
Process(1,2,3,4) |> reduce(_ + _) == Process(10)
Process(1) |> reduce(_ + _) == Process(1)
Process() |> reduce(_ + _) == Process()
Like fold1 only uses f to map A to B and uses Monoid M or associative operation
Like fold1 only uses f to map A to B and uses Monoid M or associative operation
alias for reduceMonoid
alias for reduceMonoid
Like fold only uses f to map A to B and uses Monoid M or associative operation
Like fold only uses f to map A to B and uses Monoid M or associative operation
Like fold but uses Monoid for folding operation
Like fold but uses Monoid for folding operation
alias for reduceSemigroup
alias for reduceSemigroup
Emits a single true value if all input matches the predicate.
Emits a single true value if all input matches the predicate.
Halts with false as soon as a non-matching element is received.
Repeatedly echo the input; satisfies x |> id == x and id |> x == x.
Repeatedly echo the input; satisfies x |> id == x and id |> x == x.
Emit the given values, then echo the rest of the input.
Emit the given values, then echo the rest of the input.
A Tee which alternates between emitting values from the left input and the right input.
A Tee which alternates between emitting values from the left input and the right input.
Let through the right branch as long as the left branch is false,
listening asynchronously for the left branch to become true.
Let through the right branch as long as the left branch is false,
listening asynchronously for the left branch to become true.
Add separator between elements of the input.
Add separator between elements of the input. For example,
Process(1,2,3,4) |> intersperse(0) == Process(1,0,2,0,3,0,4).
Skip all but the last element of the input.
Skip all but the last element of the input.
Skip all but the last element of the input.
Skip all but the last element of the input.
This Process will always emit exactly one value;
If the input is empty, i is emitted.
Transform the input using the given function, f.
Transform the input using the given function, f.
Transform p to operate on the left hand side of an \/, passing
through any values it receives on the right.
Transform p to operate on the left hand side of an \/, passing
through any values it receives on the right. Note that this halts
whenever p halts.
Transform p to operate on the right hand side of an \/, passing
through any values it receives on the left.
Transform p to operate on the right hand side of an \/, passing
through any values it receives on the left. Note that this halts
whenever p halts.
Create a Process[Task,String] from the lines of a file, using
the resource combinator to ensure the file is closed
when processing the stream of lines is finished.
Create a Process[Task,String] from the lines of a file, using
the resource combinator to ensure the file is closed
when processing the stream of lines is finished.
Nondeterminstic interleave of both inputs.
Nondeterminstic interleave of both inputs. Emits values whenever either of the inputs is available.
Split the input and send to either chan1 or chan2, halting when
either branch halts.
Split the input and send to either chan1 or chan2, halting when
either branch halts.
A Tee which ignores all input from left.
A Tee which ignores all input from left.
Record evaluation of p, emitting the current state along with the ouput of each step.
Record evaluation of p, emitting the current state along with the ouput of each step.
Process1 form of List.reduce.
Process1 form of List.reduce.
Reduces the elements of this Process using the specified associative binary operator.
Process(1,2,3,4) |> reduce(_ + _) == Process(10)
Process(1) |> reduce(_ + _) == Process(1)
Process() |> reduce(_ + _) == Process()
Unlike List.reduce will not fail when Process is empty.
Like reduce only uses f to map A to B and uses Monoid M or associative operation
Like reduce only uses f to map A to B and uses Monoid M or associative operation
Like reduce but uses Monoid for reduce operation
Like reduce but uses Monoid for reduce operation
Like reduce but uses Semigroup associative operation
Like reduce but uses Semigroup associative operation
Generic combinator for producing a Process[Task,O] from some
effectful O source.
Generic combinator for producing a Process[Task,O] from some
effectful O source. The source is tied to some resource,
R (like a file handle) that we want to ensure is released.
See lines below for an example use.
Throws any input exceptions and passes along successful results.
Throws any input exceptions and passes along successful results.
Similar to List.
Similar to List.scan.
Produces a process of B containing cumulative results of applying the operator to Process of A.
It will always emit z, even when the Process of A is empty
Similar to scan, but unlike it it won't emit the z even when there is no input of A.
Similar to scan, but unlike it it won't emit the z even when there is no input of A.
Process(1,2,3,4) |> scan1(_ + _) == Process(1,3,6,10)
Process(1) |> scan1(_ + _) == Process(1)
Process() |> scan1(_ + _) == Process()
Like scan1 only uses f to map A to B and uses Monoid M or associative operation
Like scan1 only uses f to map A to B and uses Monoid M or associative operation
Like scan1 but uses Monoid for associative operation
Like scan1 but uses Monoid for associative operation
Like scan only uses f to map A to B and uses Monoid M or associative operation
Like scan only uses f to map A to B and uses Monoid M or associative operation
Like scan but uses Monoid for associative operation
Like scan but uses Monoid for associative operation
Like scan1 but uses Semigroup for associative operation
Like scan1 but uses Semigroup for associative operation
Reads a single element of the input, emits nothing, then halts.
Reads a single element of the input, emits nothing, then halts.
Break the input into chunks where the delimiter matches the predicate.
Break the input into chunks where the delimiter matches the predicate. The delimiter does not appear in the output. Two adjacent delimiters in the input result in an empty chunk in the output.
Break the input into chunks where the input is equal to the given delimiter.
Break the input into chunks where the input is equal to the given delimiter. The delimiter does not appear in the output. Two adjacent delimiters in the input result in an empty chunk in the output.
The standard output stream, as a Sink.
The standard output stream, as a Sink. This Sink does not
emit newlines after each element. For that, use stdoutLines.
The standard output stream, as a Sink.
The standard output stream, as a Sink. This Sink emits
newlines after each element. If this is not desired, use stdout.
Remove any None inputs.
Remove any None inputs.
Emit a running sum of the values seen so far.
Emit a running sum of the values seen so far. The first value emitted will be the
first number seen (not 0). The length of the output Process always matches the
length of the input Process.
Passes through n elements of the input, then halts.
Passes through n elements of the input, then halts.
Like takeWhile, but emits the first value which tests false.
Like takeWhile, but emits the first value which tests false.
Passes through elements of the input as long as the predicate is true, then halts.
Passes through elements of the input as long as the predicate is true, then halts.
Wraps all inputs in Some, then outputs a single None before halting.
Wraps all inputs in Some, then outputs a single None before halting.
A Wye which blocks on the right side when either a) the age of the oldest unanswered
element from the left size exceeds the given duration, or b) the number of unanswered
elements from the left exceeds maxSize.
A Wye which blocks on the right side when either a) the age of the oldest unanswered
element from the left size exceeds the given duration, or b) the number of unanswered
elements from the left exceeds maxSize.
Wye which repeatedly awaits both branches, emitting any values
received from the right.
Wye which repeatedly awaits both branches, emitting any values
received from the right. Useful in conjunction with connect,
for instance src.connect(snk)(unboundedQueue)
Create a Channel[Task,Array[Byte],Array[Bytes]] from an InputStream by
repeatedly filling the input buffer.
Create a Channel[Task,Array[Byte],Array[Bytes]] from an InputStream by
repeatedly filling the input buffer. The last chunk may be less
than the requested size.
It is safe to recyle the same buffer for consecutive reads
as long as whatever consumes this Process never stores the Array[Byte]
returned or pipes it to a combinator (like buffer) that does.
Use chunkR for a safe version of this combinator - this takes
an Int number of bytes to read and allocates a fresh Array[Byte]
for each read.
This implementation closes the InputStream when finished
or in the event of an error.
Echoes the right branch until the left branch becomes true, then halts.
Echoes the right branch until the left branch becomes true, then halts.
Convert String inputs to UTF-8 encoded byte arrays.
Convert String inputs to UTF-8 encoded byte arrays.
Echoes the right branch when the left branch is true.
Echoes the right branch when the left branch is true.
Outputs a sliding window of size n onto the input.
Outputs a sliding window of size n onto the input.
Nondeterministic version of zip which requests both sides in parallel.
Nondeterministic version of zip which requests both sides in parallel.
Left-biased, buffered version of yip.
Left-biased, buffered version of yip. Allows up to n elements to enqueue on the
left unanswered before requiring a response from the right. If buffer is empty,
always reads from the left.
Nondeterministic version of zipWith which requests both sides in parallel.
Nondeterministic version of zipWith which requests both sides in parallel.
Left-biased, buffered version of yipWith.
Left-biased, buffered version of yipWith. Allows up to n elements to enqueue on the
left unanswered before requiring a response from the right. If buffer is empty,
always reads from the left.
Defined as zipWith((_,_))
Defined as zipWith((_,_))
A version of zip that pads the shorter stream with values.
A version of zip that pads the shorter stream with values.
Zip together two inputs, then apply the given function, halting as soon as either input is exhausted.
Zip together two inputs, then apply the given function, halting as soon as either input is exhausted. This implementation reads from the left, then the right.
A version of zipWith that pads the shorter stream with values.
A version of zipWith that pads the shorter stream with values.