ZChannel

zio.stream.ZChannel
See theZChannel companion object
sealed trait ZChannel[-Env, -InErr, -InElem, -InDone, +OutErr, +OutElem, +OutDone]

A ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone] is a nexus of I/O operations, which supports both reading and writing. A channel may read values of type InElem or process upstream failures of type InErr, while it may write values of type OutElem. When the channel finishes, it yields a value of type OutDone. A channel may fail with a value of type OutErr.

Channels are the foundation of ZIO Streams: both streams and sinks are built on channels. Most users shouldn't have to use channels directly, as streams and sinks are much more convenient and cover all common use cases. However, when adding new stream and sink operators, or doing something highly specialized, it may be useful to use channels directly.

Channels compose in a variety of ways:

  • Piping. One channel can be piped to another channel, assuming the input type of the second is the same as the output type of the first.
  • Sequencing. The terminal value of one channel can be used to create another channel, and both the first channel and the function that makes the second channel can be composed into a channel.
  • Concating. The output of one channel can be used to create other channels, which are all concatenated together. The first channel and the function that makes the other channels can be composed into a channel.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Members list

Concise view

Value members

Concrete methods

final def *>[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2]

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with the terminal value of the other channel.

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with the terminal value of the other channel.

This is a symbol operator for ZChannel#zipRight.

Attributes

final def <*[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone]

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with the terminal value of this channel.

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with the terminal value of this channel.

This is a symbol operator for ZChannel#zipLeft.

Attributes

final def <*>[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit zippable: Zippable[OutDone, OutDone2], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, Out]

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with a tuple of the terminal values of both channels.

Returns a new channel that is the sequential composition of this channel and the specified channel. The returned channel terminates with a tuple of the terminal values of both channels.

This is a symbol operator for ZChannel#zip.

Attributes

final def >>>[Env1 <: Env, OutErr2, OutElem2, OutDone2](that: => ZChannel[Env1, OutErr, OutElem, OutDone, OutErr2, OutElem2, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr2, OutElem2, OutDone2]

Returns a new channel that pipes the output of this channel into the specified channel. The returned channel has the input type of this channel, and the output type of the specified channel, terminating with the value of the specified channel.

Returns a new channel that pipes the output of this channel into the specified channel. The returned channel has the input type of this channel, and the output type of the specified channel, terminating with the value of the specified channel.

This is a symbolic operator for ZChannel#pipeTo.

Attributes

final def as[OutDone2](z2: => OutDone2)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone2]

Returns a new channel that is the same as this one, except the terminal value of the channel is the specified constant value.

Returns a new channel that is the same as this one, except the terminal value of the channel is the specified constant value.

This method produces the same result as mapping this channel to the specified constant value.

Attributes

final def catchAll[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr2, OutElem1 >: OutElem, OutDone1 >: OutDone](f: OutErr => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1]

Returns a new channel that is the same as this one, except if this channel errors for any typed error, then the returned channel will switch over to using the fallback channel returned by the specified error handler.

Returns a new channel that is the same as this one, except if this channel errors for any typed error, then the returned channel will switch over to using the fallback channel returned by the specified error handler.

Attributes

final def catchAllCause[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr2, OutElem1 >: OutElem, OutDone1 >: OutDone](f: Cause[OutErr] => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1]

Returns a new channel that is the same as this one, except if this channel errors for any cause at all, then the returned channel will switch over to using the fallback channel returned by the specified error handler.

Returns a new channel that is the same as this one, except if this channel errors for any cause at all, then the returned channel will switch over to using the fallback channel returned by the specified error handler.

Attributes

final def collect[OutElem2](f: PartialFunction[OutElem, OutElem2])(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem2, OutDone]

Returns a new channel, which is the same as this one, except its outputs are filtered and transformed by the specified partial function.

Returns a new channel, which is the same as this one, except its outputs are filtered and transformed by the specified partial function.

Attributes

final def collectElements(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, Nothing, (Chunk[OutElem], OutDone)]

Returns a new channel, which is the same as this one, except that all the outputs are collected and bundled into a tuple together with the terminal value of this channel.

Returns a new channel, which is the same as this one, except that all the outputs are collected and bundled into a tuple together with the terminal value of this channel.

As the channel returned from this channel collects all of this channel's output into an in- memory chunk, it is not safe to call this method on channels that output a large or unbounded number of values.

Attributes

final def concatMap[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2](f: OutElem => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any]

Returns a new channel whose outputs are fed to the specified factory function, which creates new channels in response. These new channels are sequentially concatenated together, and all their outputs appear as outputs of the newly returned channel.

Returns a new channel whose outputs are fed to the specified factory function, which creates new channels in response. These new channels are sequentially concatenated together, and all their outputs appear as outputs of the newly returned channel.

Attributes

final def concatMapWith[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2, OutDone2, OutDone3](f: OutElem => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, OutDone2])(g: (OutDone2, OutDone2) => OutDone2, h: (OutDone2, OutDone) => OutDone3)(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, OutDone3]

Returns a new channel whose outputs are fed to the specified factory function, which creates new channels in response. These new channels are sequentially concatenated together, and all their outputs appear as outputs of the newly returned channel. The provided merging function is used to merge the terminal values of all channels into the single terminal value of the returned channel.

Returns a new channel whose outputs are fed to the specified factory function, which creates new channels in response. These new channels are sequentially concatenated together, and all their outputs appear as outputs of the newly returned channel. The provided merging function is used to merge the terminal values of all channels into the single terminal value of the returned channel.

Attributes

final def concatOut[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2](implicit ev: OutElem <:< ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any]

Returns a new channel, which is the concatenation of all the channels that are written out by this channel. This method may only be called on channels that output other channels.

Returns a new channel, which is the concatenation of all the channels that are written out by this channel. This method may only be called on channels that output other channels.

Attributes

final def contramap[InDone0](f: InDone0 => InDone)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone0, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given function to the input channel's done value.

Returns a new channel which is the same as this one but applies the given function to the input channel's done value.

Attributes

final def contramapError[InErr0](f: InErr0 => InErr)(implicit trace: Trace): ZChannel[Env, InErr0, InElem, InDone, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given function to the input channel's error value.

Returns a new channel which is the same as this one but applies the given function to the input channel's error value.

Attributes

final def contramapErrorZIO[InErr0, Env1 <: Env](f: InErr0 => ZIO[Env1, InErr, InDone])(implicit trace: Trace): ZChannel[Env1, InErr0, InElem, InDone, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's error value.

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's error value.

Attributes

final def contramapIn[InElem0](f: InElem0 => InElem)(implicit trace: Trace): ZChannel[Env, InErr, InElem0, InDone, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given function to the input channel's output elements

Returns a new channel which is the same as this one but applies the given function to the input channel's output elements

Attributes

final def contramapInZIO[InElem0, Env1 <: Env](f: InElem0 => ZIO[Env1, InErr, InElem])(implicit trace: Trace): ZChannel[Env1, InErr, InElem0, InDone, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's output elements

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's output elements

Attributes

final def contramapZIO[InDone0, Env1 <: Env](f: InDone0 => ZIO[Env1, InErr, InDone])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone0, OutErr, OutElem, OutDone]

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's done value.

Returns a new channel which is the same as this one but applies the given ZIO function to the input channel's done value.

Attributes

final def drain(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, Nothing, OutDone]

Returns a new channel which reads all the elements from upstream's output channel and ignores them, then terminates with the upstream result value.

Returns a new channel which reads all the elements from upstream's output channel and ignores them, then terminates with the upstream result value.

Attributes

final def emitCollect(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, (Chunk[OutElem], OutDone), Unit]

Returns a new channel that collects the output and terminal value of this channel, which it then writes as output of the returned channel.

Returns a new channel that collects the output and terminal value of this channel, which it then writes as output of the returned channel.

Attributes

final def ensuring[Env1 <: Env](finalizer: => URIO[Env1, Any])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Returns a new channel with an attached finalizer. The finalizer is guaranteed to be executed so long as the channel begins execution (and regardless of whether or not it completes).

Returns a new channel with an attached finalizer. The finalizer is guaranteed to be executed so long as the channel begins execution (and regardless of whether or not it completes).

Attributes

final def ensuringWith[Env1 <: Env](finalizer: Exit[OutErr, OutDone] => URIO[Env1, Any])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Returns a new channel with an attached finalizer. The finalizer is guaranteed to be executed so long as the channel begins execution (and regardless of whether or not it completes).

Returns a new channel with an attached finalizer. The finalizer is guaranteed to be executed so long as the channel begins execution (and regardless of whether or not it completes).

Attributes

final def flatMap[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](f: OutDone => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2]

Returns a new channel, which sequentially combines this channel, together with the provided factory function, which creates a second channel based on the terminal value of this channel. The result is a channel that will first perform the functions of this channel, before performing the functions of the created channel (including yielding its terminal value).

Returns a new channel, which sequentially combines this channel, together with the provided factory function, which creates a second channel based on the terminal value of this channel. The result is a channel that will first perform the functions of this channel, before performing the functions of the created channel (including yielding its terminal value).

Attributes

final def flatten[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](implicit ev: OutDone <:< ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2]

Returns a new channel, which flattens the terminal value of this channel. This function may only be called if the terminal value of this channel is another channel of compatible types.

Returns a new channel, which flattens the terminal value of this channel. This function may only be called if the terminal value of this channel is another channel of compatible types.

Attributes

final def foldCauseChannel[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1, OutElem1 >: OutElem, OutDone1](onErr: Cause[OutErr] => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1], onSucc: OutDone => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1]

Folds over the result of this channel including any cause of termination

Folds over the result of this channel including any cause of termination

Attributes

final def foldChannel[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1, OutElem1 >: OutElem, OutDone1](onErr: OutErr => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1], onSucc: OutDone => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1]

Folds over the result of this channel

Folds over the result of this channel

Attributes

final def interruptWhen[Env1 <: Env, OutErr1 >: OutErr, OutDone1 >: OutDone](io: ZIO[Env1, OutErr1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr1, OutElem, OutDone1]

Returns a new channel, which is the same as this one, except it will be interrupted when the specified effect completes. If the effect completes successfully before the underlying channel is done, then the returned channel will yield the success value of the effect as its terminal value. On the other hand, if the underlying channel finishes first, then the returned channel will yield the success value of the underlying channel as its terminal value.

Returns a new channel, which is the same as this one, except it will be interrupted when the specified effect completes. If the effect completes successfully before the underlying channel is done, then the returned channel will yield the success value of the effect as its terminal value. On the other hand, if the underlying channel finishes first, then the returned channel will yield the success value of the underlying channel as its terminal value.

Attributes

final def interruptWhen[OutErr1 >: OutErr, OutDone1 >: OutDone](promise: Promise[OutErr1, OutDone1])(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr1, OutElem, OutDone1]

Returns a new channel, which is the same as this one, except it will be interrupted when the specified promise is completed. If the promise is completed before the underlying channel is done, then the returned channel will yield the value of the promise. Otherwise, if the underlying channel finishes first, then the returned channel will yield the value of the underlying channel.

Returns a new channel, which is the same as this one, except it will be interrupted when the specified promise is completed. If the promise is completed before the underlying channel is done, then the returned channel will yield the value of the promise. Otherwise, if the underlying channel finishes first, then the returned channel will yield the value of the underlying channel.

Attributes

final def map[OutDone2](f: OutDone => OutDone2)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone2]

Returns a new channel, which is the same as this one, except the terminal value of the returned channel is created by applying the specified function to the terminal value of this channel.

Returns a new channel, which is the same as this one, except the terminal value of the returned channel is created by applying the specified function to the terminal value of this channel.

Attributes

final def mapError[OutErr2](f: OutErr => OutErr2)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr2, OutElem, OutDone]

Returns a new channel, which is the same as this one, except the failure value of the returned channel is created by applying the specified function to the failure value of this channel.

Returns a new channel, which is the same as this one, except the failure value of the returned channel is created by applying the specified function to the failure value of this channel.

Attributes

final def mapErrorCause[OutErr2](f: Cause[OutErr] => Cause[OutErr2])(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr2, OutElem, OutDone]

A more powerful version of mapError which also surfaces the Cause of the channel failure

A more powerful version of mapError which also surfaces the Cause of the channel failure

Attributes

final def mapOut[OutElem2](f: OutElem => OutElem2)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem2, OutDone]

Creates a channel that is like this channel but the given function gets applied to each emitted output element

Creates a channel that is like this channel but the given function gets applied to each emitted output element

Attributes

final def mapOutZIO[Env1 <: Env, OutErr1 >: OutErr, OutElem2](f: OutElem => ZIO[Env1, OutErr1, OutElem2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr1, OutElem2, OutDone]

Creates a channel that is like this channel but the given ZIO function gets applied to each emitted output element

Creates a channel that is like this channel but the given ZIO function gets applied to each emitted output element

Attributes

final def mapOutZIOPar[Env1 <: Env, OutErr1 >: OutErr, OutElem2](n: Int)(f: OutElem => ZIO[Env1, OutErr1, OutElem2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr1, OutElem2, OutDone]

Creates a channel that is like this channel but the given ZIO function gets applied to each emitted output element, taking n elements at once and mapping them in parallel

Creates a channel that is like this channel but the given ZIO function gets applied to each emitted output element, taking n elements at once and mapping them in parallel

Attributes

final def mapZIO[Env1 <: Env, OutErr1 >: OutErr, OutDone2](f: OutDone => ZIO[Env1, OutErr1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr1, OutElem, OutDone2]

Returns a new channel, which is the same as this one, except the terminal value of the returned channel is created by applying the specified effectful function to the terminal value of this channel.

Returns a new channel, which is the same as this one, except the terminal value of the returned channel is created by applying the specified effectful function to the terminal value of this channel.

Attributes

final def mergeMap[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2](n: => Int, bufferSize: => Int, mergeStrategy: => MergeStrategy)(f: OutElem => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any]

Returns a new channel which creates a new channel for each emitted element and merges some of them together. Different merge strategies control what happens if there are more than the given maximum number of channels gets created. See ZChannel.mergeAll.

Returns a new channel which creates a new channel for each emitted element and merges some of them together. Different merge strategies control what happens if there are more than the given maximum number of channels gets created. See ZChannel.mergeAll.

Attributes

bufferSize

Number of elements that can be buffered from upstream for the merging

f

The function that creates a new channel from each emitted element

mergeStrategy

Merge strategy, either back pressure or sliding.

n

The maximum number of channels to merge

final def mergeOut[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2](n: => Int)(implicit ev: OutElem <:< ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, Any]

Returns a new channel which merges a number of channels emitted by this channel using the back pressuring merge strategy. See ZChannel.mergeAll

Returns a new channel which merges a number of channels emitted by this channel using the back pressuring merge strategy. See ZChannel.mergeAll

Attributes

final def mergeOutWith[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem2, OutDone1 >: OutDone](n: => Int)(f: (OutDone1, OutDone1) => OutDone1)(implicit ev: OutElem <:< ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, OutDone1], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem2, OutDone1]

Returns a new channel which merges a number of channels emitted by this channel using the back pressuring merge strategy and uses a given function to merge each completed subchannel's result value. See ZChannel.mergeAll

Returns a new channel which merges a number of channels emitted by this channel using the back pressuring merge strategy and uses a given function to merge each completed subchannel's result value. See ZChannel.mergeAll

Attributes

final def mergeWith[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr2, OutErr3, OutElem1 >: OutElem, OutDone2, OutDone3](that: ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone2])(leftDone: Exit[OutErr, OutDone] => MergeDecision[Env1, OutErr2, OutDone2, OutErr3, OutDone3], rightDone: Exit[OutErr2, OutDone2] => MergeDecision[Env1, OutErr, OutDone, OutErr3, OutDone3])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr3, OutElem1, OutDone3]

Returns a new channel, which is the merge of this channel and the specified channel, where the behavior of the returned channel on left or right early termination is decided by the specified leftDone and rightDone merge decisions.

Returns a new channel, which is the merge of this channel and the specified channel, where the behavior of the returned channel on left or right early termination is decided by the specified leftDone and rightDone merge decisions.

Attributes

final def orDie(implicit ev: OutErr <:< Throwable, trace: Trace): ZChannel[Env, InErr, InElem, InDone, Nothing, OutElem, OutDone]

Translates channel failure into death of the fiber, making all failures unchecked and not a part of the type of the channel.

Translates channel failure into death of the fiber, making all failures unchecked and not a part of the type of the channel.

Attributes

final def orDieWith(f: OutErr => Throwable)(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, Nothing, OutElem, OutDone]

Keeps none of the errors, and terminates the fiber with them, using the specified function to convert the OutErr into a Throwable.

Keeps none of the errors, and terminates the fiber with them, using the specified function to convert the OutErr into a Throwable.

Attributes

final def orElse[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr2, OutElem1 >: OutElem, OutDone1 >: OutDone](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone1]

Returns a new channel that will perform the operations of this one, until failure, and then it will switch over to the operations of the specified fallback channel.

Returns a new channel that will perform the operations of this one, until failure, and then it will switch over to the operations of the specified fallback channel.

Attributes

final def pipeTo[Env1 <: Env, OutErr2, OutElem2, OutDone2](that: => ZChannel[Env1, OutErr, OutElem, OutDone, OutErr2, OutElem2, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr2, OutElem2, OutDone2]

Returns a new channel that pipes the output of this channel into the specified channel. The returned channel has the input type of this channel, and the output type of the specified channel, terminating with the value of the specified channel.

Returns a new channel that pipes the output of this channel into the specified channel. The returned channel has the input type of this channel, and the output type of the specified channel, terminating with the value of the specified channel.

Same as the symbolic operator &gt;&gt;&gt;

Attributes

final def pipeToOrFail[Env1 <: Env, OutErr1 >: OutErr, OutElem2, OutDone2](that: => ZChannel[Env1, Nothing, OutElem, OutDone, OutErr1, OutElem2, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr, InElem, InDone, OutErr1, OutElem2, OutDone2]

Returns a new channel that pipes the output of this channel into the specified channel and preserves this channel's failures without providing them to the other channel for observation.

Returns a new channel that pipes the output of this channel into the specified channel and preserves this channel's failures without providing them to the other channel for observation.

Attributes

final def provideEnvironment(env: => ZEnvironment[Env])(implicit trace: Trace): ZChannel[Any, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Provides the channel with its required environment, which eliminates its dependency on Env.

Provides the channel with its required environment, which eliminates its dependency on Env.

Attributes

final def provideLayer[OutErr1 >: OutErr, Env0](layer: => ZLayer[Env0, OutErr1, Env])(implicit trace: Trace): ZChannel[Env0, InErr, InElem, InDone, OutErr1, OutElem, OutDone]

Provides a layer to the channel, which translates it to another level.

Provides a layer to the channel, which translates it to another level.

Attributes

final def provideSomeEnvironment[Env0](f: ZEnvironment[Env0] => ZEnvironment[Env])(implicit trace: Trace): ZChannel[Env0, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Transforms the environment being provided to the channel with the specified function.

Transforms the environment being provided to the channel with the specified function.

Attributes

final def provideSomeLayer[Env0]: ProvideSomeLayer[Env0, Env, InErr, InElem, InDone, OutErr, OutElem, OutDone]

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder Env0.

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder Env0.

Attributes

final def repeated(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, Nothing]

Creates a channel which repeatedly runs this channel

Creates a channel which repeatedly runs this channel

Attributes

final def run(implicit ev1: Any <:< InElem, ev2: OutElem <:< Nothing, trace: Trace): ZIO[Env, OutErr, OutDone]

Run the channel until it finishes with a done value or fails with an error. The channel must not read any input or write any output.

Run the channel until it finishes with a done value or fails with an error. The channel must not read any input or write any output.

Attributes

final def runCollect(implicit ev1: Any <:< InElem, trace: Trace): ZIO[Env, OutErr, (Chunk[OutElem], OutDone)]

Run the channel until it finishes with a done value or fails with an error and collects its emitted output elements.

Run the channel until it finishes with a done value or fails with an error and collects its emitted output elements.

The channel must not read any input.

Attributes

final def runDrain(implicit ev1: Any <:< InElem, trace: Trace): ZIO[Env, OutErr, OutDone]

Run the channel until it finishes with a done value or fails with an error and ignores its emitted output elements.

Run the channel until it finishes with a done value or fails with an error and ignores its emitted output elements.

The channel must not read any input.

Attributes

final def runScoped(implicit ev1: Any <:< InElem, ev2: OutElem <:< Nothing, trace: Trace): ZIO[Env & Scope, OutErr, OutDone]

Run the channel until it finishes with a done value or fails with an error. The channel must not read any input or write any output.

Run the channel until it finishes with a done value or fails with an error. The channel must not read any input or write any output.

Closing the channel, which includes execution of all the finalizers attached to the channel will be added to the current scope as a finalizer.

Attributes

final def toPipeline[In, Out](implicit In: Chunk[In] <:< InElem, Out: OutElem <:< Chunk[Out], InDone: Any <:< InDone, trace: Trace): ZPipeline[Env, OutErr, In, Out]

Converts this channel to a ZPipeline

Converts this channel to a ZPipeline

Attributes

final def toPull(implicit trace: Trace): ZIO[Env & Scope, Nothing, ZIO[Env, OutErr, Either[OutDone, OutElem]]]

Returns in a scope a ZIO effect that can be used to repeatedly pull elements from the channel. The pull effect fails with the channel's failure in case the channel fails, or returns either the channel's done value or an emitted element.

Returns in a scope a ZIO effect that can be used to repeatedly pull elements from the channel. The pull effect fails with the channel's failure in case the channel fails, or returns either the channel's done value or an emitted element.

Attributes

final def toSink[In, Out](implicit In: Chunk[In] <:< InElem, Out: OutElem <:< Chunk[Out], InDone: Any <:< InDone, trace: Trace): ZSink[Env, OutErr, In, Out, OutDone]

Converts this channel to a ZSink

Converts this channel to a ZSink

Attributes

final def toStream[Out](implicit Out: OutElem <:< Chunk[Out], InErr: Any <:< InErr, InElem: Any <:< InElem, InDone: Any <:< InDone, trace: Trace): ZStream[Env, OutErr, Out]

Converts this channel to a ZStream

Converts this channel to a ZStream

Attributes

final def unit(implicit trace: Trace): ZChannel[Env, InErr, InElem, InDone, OutErr, OutElem, Unit]

Creates a new channel which is like this channel but returns with the unit value when succeeds

Creates a new channel which is like this channel but returns with the unit value when succeeds

Attributes

final def updateService[Service]: UpdateService[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone, Service]

Updates a service in the environment of this channel.

Updates a service in the environment of this channel.

Attributes

final def updateServiceAt[Service]: UpdateServiceAt[Env, InErr, InElem, InDone, OutErr, OutElem, OutDone, Service]

Updates a service at the specified key in the environment of this channel.

Updates a service at the specified key in the environment of this channel.

Attributes

final def zip[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit zippable: Zippable[OutDone, OutDone2], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, Out]

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the zipped done value of both channels

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the zipped done value of both channels

Attributes

final def zipLeft[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone]

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the done value of the first channel

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the done value of the first channel

Attributes

final def zipPar[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit zippable: Zippable[OutDone, OutDone2], trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, Out]

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with a tuple of both channel's done value

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with a tuple of both channel's done value

Attributes

final def zipParLeft[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone]

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with the first one's done value

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with the first one's done value

Attributes

def zipParRight[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2]

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with the second one's done value

Creates a new channel which runs in parallel this and the other channel and when both succeeds finishes with the second one's done value

Attributes

final def zipRight[Env1 <: Env, InErr1 <: InErr, InElem1 <: InElem, InDone1 <: InDone, OutErr1 >: OutErr, OutElem1 >: OutElem, OutDone2](that: => ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2])(implicit trace: Trace): ZChannel[Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2]

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the done value of the second channel

Creates a new channel which first runs this channel and if it succeeds runs the other channel and finally finishes with the done value of the second channel

Attributes

Deprecated methods

final def never(implicit trace: Trace): ZChannel[Any, Any, Any, Any, Nothing, Nothing, Nothing]

Returns a channel that never completes

Returns a channel that never completes

Attributes

Deprecated
true