ZStream

object ZStream
Companion:
class
class Object
trait Matchable
class Any
ZStream.type

Type members

Classlikes

trait Emit[+R, -E, -A, +B] extends ZIO[R, Option[E], Chunk[A]] => B

An Emit[R, E, A, B] represents an asynchronous callback that can be called multiple times. The callback can be called with a value of type ZIO[R, Option[E], Chunk[A]], where succeeding with a Chunk[A] indicates to emit those elements, failing with Some[E] indicates to terminate with that error, and failing with None indicates to terminate with an end of stream signal.

An Emit[R, E, A, B] represents an asynchronous callback that can be called multiple times. The callback can be called with a value of type ZIO[R, Option[E], Chunk[A]], where succeeding with a Chunk[A] indicates to emit those elements, failing with Some[E] indicates to terminate with that error, and failing with None indicates to terminate with an end of stream signal.

final class EnvironmentWithPartiallyApplied[R](dummy: Boolean) extends AnyVal
final class EnvironmentWithStreamPartiallyApplied[R](dummy: Boolean) extends AnyVal
final class EnvironmentWithZIOPartiallyApplied[R](dummy: Boolean) extends AnyVal
sealed trait GroupBy[-R, +E, +K, +V]

Representation of a grouped stream. This allows to filter which groups will be processed. Once this is applied all groups will be processed in parallel and the results will be merged in arbitrary order.

Representation of a grouped stream. This allows to filter which groups will be processed. Once this is applied all groups will be processed in parallel and the results will be merged in arbitrary order.

Companion:
class
sealed trait HaltStrategy
Companion:
object
final class ProvideSomeLayer[R0, -R, +E, +A](self: ZStream[R, E, A]) extends AnyVal
final implicit class RefineToOrDieOps[R, E <: Throwable, A](self: ZStream[R, E, A]) extends AnyVal
final class ScopedPartiallyApplied[R](dummy: Boolean) extends AnyVal
final class ServiceAtPartiallyApplied[Service](dummy: Boolean) extends AnyVal
final class ServiceWithPartiallyApplied[Service](dummy: Boolean) extends AnyVal
final class ServiceWithStreamPartiallyApplied[Service](dummy: Boolean) extends AnyVal
final class ServiceWithZIOPartiallyApplied[Service](dummy: Boolean) extends AnyVal
final implicit class SortedByKey[R, E, K, A](self: ZStream[R, E, (K, A)])

Provides extension methods for streams that are sorted by distinct keys.

Provides extension methods for streams that are sorted by distinct keys.

final implicit class SyntaxOps[-R, +E, O](self: ZStream[R, E, O])
final class UnwrapScopedPartiallyApplied[R](dummy: Boolean) extends AnyVal
final class UpdateService[-R, +E, +A, M](self: ZStream[R, E, A]) extends AnyVal
final class UpdateServiceAt[-R, +E, +A, Service](self: ZStream[R, E, A]) extends AnyVal
final class WhenCaseZIO[R, E, A](a: () => ZIO[R, E, A]) extends AnyVal
final class WhenZIO[R, E](b: () => ZIO[R, E, Boolean]) extends AnyVal
trait ZStreamConstructor[Input]

A ZStreamConstructor[Input] knows how to construct a ZStream value from an input of type Input. This allows the type of the ZStream value constructed to depend on Input.

A ZStreamConstructor[Input] knows how to construct a ZStream value from an input of type Input. This allows the type of the ZStream value constructed to depend on Input.

Companion:
object

Types

type Pull[-R, +E, +A] = ZIO[R, Option[E], Chunk[A]]

Value members

Concrete methods

def absolve[R, E, O](xs: ZStream[R, E, Either[E, O]])(implicit trace: Trace): ZStream[R, E, O]

Submerges the error case of an Either into the ZStream.

Submerges the error case of an Either into the ZStream.

def acquireReleaseExitWith[R, E, A](acquire: => ZIO[R, E, A])(release: (A, Exit[Any, Any]) => URIO[R, Any])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from a single value that will get cleaned up after the stream is consumed

Creates a stream from a single value that will get cleaned up after the stream is consumed

def acquireReleaseWith[R, E, A](acquire: => ZIO[R, E, A])(release: A => URIO[R, Any])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from a single value that will get cleaned up after the stream is consumed

Creates a stream from a single value that will get cleaned up after the stream is consumed

def apply[A](as: A*)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a pure stream from a variable list of values

Creates a pure stream from a variable list of values

def blocking[R, E, A](stream: => ZStream[R, E, A])(implicit trace: Trace): ZStream[R, E, A]

Locks the execution of the specified stream to the blocking executor. Any streams that are composed after this one will automatically be shifted back to the previous executor.

Locks the execution of the specified stream to the blocking executor. Any streams that are composed after this one will automatically be shifted back to the previous executor.

def concatAll[R, E, O](streams: => Chunk[ZStream[R, E, O]])(implicit trace: Trace): ZStream[R, E, O]

Concatenates all of the streams in the chunk to one stream.

Concatenates all of the streams in the chunk to one stream.

def debug(value: => Any)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Prints the specified message to the console for debugging purposes.

Prints the specified message to the console for debugging purposes.

def die(ex: => Throwable)(implicit trace: Trace): ZStream[Any, Nothing, Nothing]

The stream that dies with the ex.

The stream that dies with the ex.

def dieMessage(msg: => String)(implicit trace: Trace): ZStream[Any, Nothing, Nothing]

The stream that dies with an exception described by msg.

The stream that dies with an exception described by msg.

def done[E, A](exit: => Exit[E, A])(implicit trace: Trace): ZStream[Any, E, A]

The stream that ends with the zio.Exit value exit.

The stream that ends with the zio.Exit value exit.

def empty(implicit trace: Trace): ZStream[Any, Nothing, Nothing]

The empty stream

The empty stream

def environment[R](implicit trace: Trace): ZStream[R, Nothing, ZEnvironment[R]]

Accesses the whole environment of the stream.

Accesses the whole environment of the stream.

Accesses the environment of the stream.

Accesses the environment of the stream.

Accesses the environment of the stream in the context of a stream.

Accesses the environment of the stream in the context of a stream.

Accesses the environment of the stream in the context of an effect.

Accesses the environment of the stream in the context of an effect.

def execute[R, E](zio: => ZIO[R, E, Any])(implicit trace: Trace): ZStream[R, E, Nothing]

Creates a stream that executes the specified effect but emits no elements.

Creates a stream that executes the specified effect but emits no elements.

def fail[E](error: => E)(implicit trace: Trace): ZStream[Any, E, Nothing]

The stream that always fails with the error

The stream that always fails with the error

def failCause[E](cause: => Cause[E])(implicit trace: Trace): ZStream[Any, E, Nothing]

The stream that always fails with cause.

The stream that always fails with cause.

def finalizer[R](finalizer: => URIO[R, Any])(implicit trace: Trace): ZStream[R, Nothing, Any]

Creates a one-element stream that never fails and executes the finalizer when it ends.

Creates a one-element stream that never fails and executes the finalizer when it ends.

def from[Input](input: => Input)(implicit constructor: ZStreamConstructor[Input], trace: Trace): Out
def fromChannel[R, E, A](channel: ZChannel[R, Any, Any, Any, E, Chunk[A], Any]): ZStream[R, E, A]

Creates a stream from a zio.stream.ZChannel

Creates a stream from a zio.stream.ZChannel

def fromChunk[O](chunk: => Chunk[O])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a zio.Chunk of values

Creates a stream from a zio.Chunk of values

Value parameters:
c

a chunk of values

Returns:

a finite stream of values

def fromChunkHub[O](hub: => Hub[Chunk[O]])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a subscription to a hub.

Creates a stream from a subscription to a hub.

def fromChunkHubScoped[O](hub: => Hub[Chunk[O]])(implicit trace: Trace): ZIO[Scope, Nothing, ZStream[Any, Nothing, O]]

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

def fromChunkHubScopedWithShutdown[O](hub: => Hub[Chunk[O]])(implicit trace: Trace): ZIO[Scope, Nothing, ZStream[Any, Nothing, O]]

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

The hub will be shut down once the stream is closed.

def fromChunkHubWithShutdown[O](hub: => Hub[Chunk[O]])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a subscription to a hub.

Creates a stream from a subscription to a hub.

The hub will be shut down once the stream is closed.

def fromChunkQueue[O](queue: => Dequeue[Chunk[O]])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a queue of values

Creates a stream from a queue of values

def fromChunkQueueWithShutdown[O](queue: => Dequeue[Chunk[O]])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.

Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.

def fromChunks[O](cs: Chunk[O]*)(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from an arbitrary number of chunks.

Creates a stream from an arbitrary number of chunks.

def fromHub[A](hub: => Hub[A], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from a subscription to a hub.

Creates a stream from a subscription to a hub.

def fromHubScoped[A](hub: => Hub[A], maxChunkSize: => Int)(implicit trace: Trace): ZIO[Scope, Nothing, ZStream[Any, Nothing, A]]

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

def fromHubScopedWithShutdown[A](hub: => Hub[A], maxChunkSize: => Int)(implicit trace: Trace): ZIO[Scope, Nothing, ZStream[Any, Nothing, A]]

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

Creates a stream from a subscription to a hub in the context of a scoped effect. The scoped effect describes subscribing to receive messages from the hub while the stream describes taking messages from the hub.

The hub will be shut down once the stream is closed.

def fromHubWithShutdown[A](hub: => Hub[A], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from a subscription to a hub.

Creates a stream from a subscription to a hub.

The hub will be shut down once the stream is closed.

def fromInputStream(is: => InputStream, chunkSize: => Int)(implicit trace: Trace): ZStream[Any, IOException, Byte]

Creates a stream from a java.io.InputStream

Creates a stream from a java.io.InputStream

def fromInputStreamScoped[R](is: => ZIO[Scope & R, IOException, InputStream], chunkSize: => Int)(implicit trace: Trace): ZStream[R, IOException, Byte]

Creates a stream from a scoped java.io.InputStream value.

Creates a stream from a scoped java.io.InputStream value.

def fromInputStreamZIO[R](is: => ZIO[R, IOException, InputStream], chunkSize: => Int)(implicit trace: Trace): ZStream[R, IOException, Byte]

Creates a stream from a java.io.InputStream. Ensures that the input stream is closed after it is exhausted.

Creates a stream from a java.io.InputStream. Ensures that the input stream is closed after it is exhausted.

def fromIterable[O](as: => Iterable[O])(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from an iterable collection of values

Creates a stream from an iterable collection of values

def fromIterable[O](as: => Iterable[O], chunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from an iterable collection of values

Creates a stream from an iterable collection of values

def fromIterableZIO[R, E, O](iterable: => ZIO[R, E, Iterable[O]])(implicit trace: Trace): ZStream[R, E, O]

Creates a stream from an effect producing a value of type Iterable[A]

Creates a stream from an effect producing a value of type Iterable[A]

def fromIterableZIO[R, E, O](iterable: => ZIO[R, E, Iterable[O]], chunkSize: => Int)(implicit trace: Trace): ZStream[R, E, O]

Creates a stream from an effect producing a value of type Iterable[A]

Creates a stream from an effect producing a value of type Iterable[A]

def fromIterator[A](iterator: => Iterator[A], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Throwable, A]

Creates a stream from an iterator

Creates a stream from an iterator

def fromIteratorScoped[R, A](iterator: => ZIO[Scope & R, Throwable, Iterator[A]], maxChunkSize: => Int)(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from a scoped iterator

Creates a stream from a scoped iterator

def fromIteratorSucceed[A](iterator: => Iterator[A], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from an iterator

Creates a stream from an iterator

def fromIteratorZIO[R, A](iterator: => ZIO[R, Throwable, Iterator[A]])(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from an iterator that may potentially throw exceptions

Creates a stream from an iterator that may potentially throw exceptions

def fromIteratorZIO[R, A](iterator: => ZIO[R, Throwable, Iterator[A]], chunkSize: Int)(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from an iterator that may potentially throw exceptions

Creates a stream from an iterator that may potentially throw exceptions

def fromJavaIterator[A](iterator: => Iterator[A])(implicit trace: Trace): ZStream[Any, Throwable, A]

Creates a stream from a Java iterator that may throw exceptions

Creates a stream from a Java iterator that may throw exceptions

def fromJavaIterator[A](iterator: => Iterator[A], chunkSize: Int)(implicit trace: Trace): ZStream[Any, Throwable, A]

Creates a stream from a Java iterator that may throw exceptions

Creates a stream from a Java iterator that may throw exceptions

def fromJavaIteratorScoped[R, A](iterator: => ZIO[Scope & R, Throwable, Iterator[A]])(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from a scoped iterator

Creates a stream from a scoped iterator

def fromJavaIteratorScoped[R, A](iterator: => ZIO[Scope & R, Throwable, Iterator[A]], chunkSize: Int)(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from a scoped iterator

Creates a stream from a scoped iterator

def fromJavaIteratorSucceed[A](iterator: => Iterator[A])(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from a Java iterator

Creates a stream from a Java iterator

def fromJavaIteratorSucceed[A](iterator: => Iterator[A], chunkSize: Int)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from a Java iterator

Creates a stream from a Java iterator

def fromJavaIteratorZIO[R, A](iterator: => ZIO[R, Throwable, Iterator[A]])(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from a Java iterator that may potentially throw exceptions

Creates a stream from a Java iterator that may potentially throw exceptions

def fromJavaIteratorZIO[R, A](iterator: => ZIO[R, Throwable, Iterator[A]], chunkSize: Int)(implicit trace: Trace): ZStream[R, Throwable, A]

Creates a stream from a Java iterator that may potentially throw exceptions

Creates a stream from a Java iterator that may potentially throw exceptions

def fromPull[R, E, A](zio: ZIO[Scope & R, Nothing, ZIO[R, Option[E], Chunk[A]]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from a ZIO effect that pulls elements from another stream. See toPull for reference

Creates a stream from a ZIO effect that pulls elements from another stream. See toPull for reference

def fromQueue[O](queue: => Dequeue[O], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a queue of values

Creates a stream from a queue of values

Value parameters:
maxChunkSize

Maximum number of queued elements to put in one chunk in the stream

def fromQueueWithShutdown[O](queue: => Dequeue[O], maxChunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, O]

Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.

Creates a stream from a queue of values. The queue will be shutdown once the stream is closed.

Value parameters:
maxChunkSize

Maximum number of queued elements to put in one chunk in the stream

def fromSchedule[R, A](schedule: => Schedule[R, Any, A])(implicit trace: Trace): ZStream[R, Nothing, A]

Creates a stream from a zio.Schedule that does not require any further input. The stream will emit an element for each value output from the schedule, continuing for as long as the schedule continues.

Creates a stream from a zio.Schedule that does not require any further input. The stream will emit an element for each value output from the schedule, continuing for as long as the schedule continues.

def fromTQueue[A](queue: => TDequeue[A])(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream from a zio.stm.TQueue of values.

Creates a stream from a zio.stm.TQueue of values.

def fromZIO[R, E, A](fa: => ZIO[R, E, A])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing a value of type A

Creates a stream from an effect producing a value of type A

def fromZIOOption[R, E, A](fa: => ZIO[R, Option[E], A])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing a value of type A or an empty Stream

Creates a stream from an effect producing a value of type A or an empty Stream

def iterate[A](a: => A)(f: A => A)(implicit trace: Trace): ZStream[Any, Nothing, A]

The infinite stream of iterative function application: a, f(a), f(f(a)), f(f(f(a))), ...

The infinite stream of iterative function application: a, f(a), f(f(a)), f(f(f(a))), ...

def log(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the current log level.

Logs the specified message at the current log level.

def logAnnotate(key: => String, value: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

def logAnnotate(annotation: => LogAnnotation, annotations: LogAnnotation*)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

def logAnnotate(annotations: => Set[LogAnnotation])(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

def logAnnotations(implicit trace: Trace): ZStream[Any, Nothing, Map[String, String]]

Retrieves the log annotations associated with the current scope.

Retrieves the log annotations associated with the current scope.

def logDebug(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the debug log level.

Logs the specified message at the debug log level.

def logError(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the error log level.

Logs the specified message at the error log level.

def logErrorCause(cause: => Cause[Any])(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified cause as an error.

Logs the specified cause as an error.

def logFatal(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the fatal log level.

Logs the specified message at the fatal log level.

def logInfo(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the informational log level.

Logs the specified message at the informational log level.

def logLevel(level: LogLevel)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Sets the log level for streams composed after this.

Sets the log level for streams composed after this.

def logSpan(label: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Adjusts the label for the logging span for streams composed after this.

Adjusts the label for the logging span for streams composed after this.

def logTrace(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the trace log level.

Logs the specified message at the trace log level.

def logWarning(message: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Logs the specified message at the warning log level.

Logs the specified message at the warning log level.

def mergeAll[R, E, O](n: => Int, outputBuffer: => Int)(streams: ZStream[R, E, O]*)(implicit trace: Trace): ZStream[R, E, O]

Merges a variable list of streams in a non-deterministic fashion. Up to n streams may be consumed in parallel and up to outputBuffer chunks may be buffered by this operator.

Merges a variable list of streams in a non-deterministic fashion. Up to n streams may be consumed in parallel and up to outputBuffer chunks may be buffered by this operator.

def mergeAllUnbounded[R, E, O](outputBuffer: => Int)(streams: ZStream[R, E, O]*)(implicit trace: Trace): ZStream[R, E, O]

Like mergeAll, but runs all streams concurrently.

Like mergeAll, but runs all streams concurrently.

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

The stream that never produces any value or fails with any error.

The stream that never produces any value or fails with any error.

def paginate[R, E, A, S](s: => S)(f: S => (A, Option[S]))(implicit trace: Trace): ZStream[Any, Nothing, A]

Like unfold, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

Like unfold, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

def paginateChunk[A, S](s: => S)(f: S => (Chunk[A], Option[S]))(implicit trace: Trace): ZStream[Any, Nothing, A]

Like unfoldChunk, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

Like unfoldChunk, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

def paginateChunkZIO[R, E, A, S](s: => S)(f: S => ZIO[R, E, (Chunk[A], Option[S])])(implicit trace: Trace): ZStream[R, E, A]

Like unfoldChunkZIO, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

Like unfoldChunkZIO, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

def paginateZIO[R, E, A, S](s: => S)(f: S => ZIO[R, E, (A, Option[S])])(implicit trace: Trace): ZStream[R, E, A]

Like unfoldZIO, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

Like unfoldZIO, but allows the emission of values to end one step further than the unfolding of the state. This is useful for embedding paginated APIs, hence the name.

def provideLayer[RIn, E, ROut, RIn2, ROut2](layer: ZLayer[RIn, E, ROut])(stream: => ZStream[ROut & RIn2, E, ROut2])(implicit ev: Tag[RIn2], tag: Tag[ROut], trace: Trace): ZStream[RIn & RIn2, E, ROut2]
def range(min: => Int, max: => Int, chunkSize: => Int)(implicit trace: Trace): ZStream[Any, Nothing, Int]

Constructs a stream from a range of integers (lower bound included, upper bound not included)

Constructs a stream from a range of integers (lower bound included, upper bound not included)

def repeat[A](a: => A)(implicit trace: Trace): ZStream[Any, Nothing, A]

Repeats the provided value infinitely.

Repeats the provided value infinitely.

def repeatWithSchedule[R, A](a: => A, schedule: => Schedule[R, A, _])(implicit trace: Trace): ZStream[R, Nothing, A]

Repeats the value using the provided schedule.

Repeats the value using the provided schedule.

def repeatZIO[R, E, A](fa: => ZIO[R, E, A])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing a value of type A which repeats forever.

Creates a stream from an effect producing a value of type A which repeats forever.

def repeatZIOChunk[R, E, A](fa: => ZIO[R, E, Chunk[A]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing chunks of A values which repeats forever.

Creates a stream from an effect producing chunks of A values which repeats forever.

def repeatZIOChunkOption[R, E, A](fa: => ZIO[R, Option[E], Chunk[A]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing chunks of A values until it fails with None.

Creates a stream from an effect producing chunks of A values until it fails with None.

def repeatZIOOption[R, E, A](fa: => ZIO[R, Option[E], A])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing values of type A until it fails with None.

Creates a stream from an effect producing values of type A until it fails with None.

def repeatZIOWithSchedule[R, E, A](effect: => ZIO[R, E, A], schedule: => Schedule[R, A, Any])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an effect producing a value of type A, which is repeated using the specified schedule.

Creates a stream from an effect producing a value of type A, which is repeated using the specified schedule.

Creates a single-valued stream from a scoped resource

Creates a single-valued stream from a scoped resource

def service[A : Tag](implicit evidence$1: Tag[A], trace: Trace): ZStream[A, Nothing, A]

Accesses the specified service in the environment of the effect.

Accesses the specified service in the environment of the effect.

def serviceAt[Service]: ServiceAtPartiallyApplied[Service]

Accesses the service corresponding to the specified key in the environment.

Accesses the service corresponding to the specified key in the environment.

Accesses the specified service in the environment of the stream.

Accesses the specified service in the environment of the stream.

Accesses the specified service in the environment of the stream in the context of a stream.

Accesses the specified service in the environment of the stream in the context of a stream.

Accesses the specified service in the environment of the stream in the context of an effect.

Accesses the specified service in the environment of the stream in the context of an effect.

def succeed[A](a: => A)(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a single-valued pure stream

Creates a single-valued pure stream

def suspend[R, E, A](stream: => ZStream[R, E, A]): ZStream[R, E, A]

Returns a lazily constructed stream.

Returns a lazily constructed stream.

def tagged(key: => String, value: => String)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each metric in streams composed after this with the specified tag.

Annotates each metric in streams composed after this with the specified tag.

def tagged(tag: => MetricLabel, tags: MetricLabel*)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each metric in streams composed after this with the specified tag.

Annotates each metric in streams composed after this with the specified tag.

def tagged(tags: => Set[MetricLabel])(implicit trace: Trace): ZStream[Any, Nothing, Unit]

Annotates each metric in streams composed after this with the specified tag.

Annotates each metric in streams composed after this with the specified tag.

def tags(implicit trace: Trace): ZStream[Any, Nothing, Set[MetricLabel]]

Retrieves the metric tags associated with the current scope.

Retrieves the metric tags associated with the current scope.

def tick(interval: => Duration)(implicit trace: Trace): ZStream[Any, Nothing, Unit]

A stream that emits Unit values spaced by the specified duration.

A stream that emits Unit values spaced by the specified duration.

def unfold[S, A](s: => S)(f: S => Option[(A, S)])(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream by peeling off the "layers" of a value of type S

Creates a stream by peeling off the "layers" of a value of type S

def unfoldChunk[S, A](s: => S)(f: S => Option[(Chunk[A], S)])(implicit trace: Trace): ZStream[Any, Nothing, A]

Creates a stream by peeling off the "layers" of a value of type S.

Creates a stream by peeling off the "layers" of a value of type S.

def unfoldChunkZIO[R, E, A, S](s: => S)(f: S => ZIO[R, E, Option[(Chunk[A], S)]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream by effectfully peeling off the "layers" of a value of type S

Creates a stream by effectfully peeling off the "layers" of a value of type S

def unfoldZIO[R, E, A, S](s: => S)(f: S => ZIO[R, E, Option[(A, S)]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream by effectfully peeling off the "layers" of a value of type S

Creates a stream by effectfully peeling off the "layers" of a value of type S

def unwrap[R, E, A](fa: => ZIO[R, E, ZStream[R, E, A]])(implicit trace: Trace): ZStream[R, E, A]

Creates a stream produced from an effect

Creates a stream produced from an effect

Creates a stream produced from a scoped ZIO

Creates a stream produced from a scoped ZIO

def when[R, E, O](b: => Boolean)(zStream: => ZStream[R, E, O])(implicit trace: Trace): ZStream[R, E, O]

Returns the specified stream if the given condition is satisfied, otherwise returns an empty stream.

Returns the specified stream if the given condition is satisfied, otherwise returns an empty stream.

def whenCase[R, E, A, O](a: => A)(pf: PartialFunction[A, ZStream[R, E, O]])(implicit trace: Trace): ZStream[R, E, O]

Returns the resulting stream when the given PartialFunction is defined for the given value, otherwise returns an empty stream.

Returns the resulting stream when the given PartialFunction is defined for the given value, otherwise returns an empty stream.

def whenCaseZIO[R, E, A](a: => ZIO[R, E, A]): WhenCaseZIO[R, E, A]

Returns the resulting stream when the given PartialFunction is defined for the given effectful value, otherwise returns an empty stream.

Returns the resulting stream when the given PartialFunction is defined for the given effectful value, otherwise returns an empty stream.

def whenZIO[R, E](b: => ZIO[R, E, Boolean]): WhenZIO[R, E]

Returns the specified stream if the given effectful condition is satisfied, otherwise returns an empty stream.

Returns the specified stream if the given effectful condition is satisfied, otherwise returns an empty stream.

Inherited methods

def async[R, E, A](register: Emit[R, E, A, Future[Boolean]] => Unit, outputBuffer: => Int)(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an asynchronous callback that can be called multiple times. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Creates a stream from an asynchronous callback that can be called multiple times. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Inherited from:
ZStreamPlatformSpecificConstructors (hidden)
def asyncInterrupt[R, E, A](register: Emit[R, E, A, Future[Boolean]] => Either[URIO[R, Any], ZStream[R, E, A]], outputBuffer: => Int)(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback returns either a canceler or synchronously returns a stream. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback returns either a canceler or synchronously returns a stream. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Inherited from:
ZStreamPlatformSpecificConstructors (hidden)
def asyncMaybe[R, E, A](register: Emit[R, E, A, Future[Boolean]] => Option[ZStream[R, E, A]], outputBuffer: => Int)(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback can possibly return the stream synchronously. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback can possibly return the stream synchronously. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Inherited from:
ZStreamPlatformSpecificConstructors (hidden)
def asyncScoped[R, E, A](register: (ZIO[R, Option[E], Chunk[A]] => Future[Boolean]) => ZIO[R & Scope, E, Any], outputBuffer: => Int)(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback itself returns an a scoped resource. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Creates a stream from an asynchronous callback that can be called multiple times. The registration of the callback itself returns an a scoped resource. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Inherited from:
ZStreamPlatformSpecificConstructors (hidden)
def asyncZIO[R, E, A](register: Emit[R, E, A, Future[Boolean]] => ZIO[R, E, Any], outputBuffer: => Int)(implicit trace: Trace): ZStream[R, E, A]

Creates a stream from an asynchronous callback that can be called multiple times The registration of the callback itself returns an effect. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Creates a stream from an asynchronous callback that can be called multiple times The registration of the callback itself returns an effect. The optionality of the error type E can be used to signal the end of the stream, by setting it to None.

Inherited from:
ZStreamPlatformSpecificConstructors (hidden)

Concrete fields

final val DefaultChunkSize: 4096

The default chunk size used by the various combinators and constructors of ZStream.

The default chunk size used by the various combinators and constructors of ZStream.

val unit: ZStream[Any, Nothing, Unit]

A stream that contains a single Unit value.

A stream that contains a single Unit value.

Implicits

Implicits

final implicit def RefineToOrDieOps[R, E <: Throwable, A](self: ZStream[R, E, A]): RefineToOrDieOps[R, E, A]
final implicit def SortedByKey[R, E, K, A](self: ZStream[R, E, (K, A)]): SortedByKey[R, E, K, A]

Provides extension methods for streams that are sorted by distinct keys.

Provides extension methods for streams that are sorted by distinct keys.

final implicit def SyntaxOps[R, E, O](self: ZStream[R, E, O]): SyntaxOps[R, E, O]