zio.blocks.streams
Members list
Packages
Type members
Classlikes
Genuinely non-blocking JVM reader factories. NioReaders remains the API for blocking ReadableByteChannels.
Genuinely non-blocking JVM reader factories. NioReaders remains the API for blocking ReadableByteChannels.
Attributes
- Source
- AsyncNioReaders.scala
- Supertypes
- Self type
-
AsyncNioReaders.type
This object was generated by sbt-buildinfo.
This object was generated by sbt-buildinfo.
Attributes
- Source
- BuildInfo.scala
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
BuildInfo.type
Tag identifying which JVM type A corresponds to: one of the 8 primitives, or AnyRef for reference types.
Tag identifying which JVM type A corresponds to: one of the 8 primitives, or AnyRef for reference types.
Used throughout the streaming library for runtime specialization dispatch:
- zio.blocks.streams.io.Reader checks
jvmTypeto select sentinel-return pull paths (readInt,readLong, etc.). - zio.blocks.streams.Sink dispatches on
jvmTypeto avoid boxing in drain, fold, and collect loops.
Identity comparison (eq) is safe because each variant is a singleton case object.
Value parameters
- ordinal
-
Stable integer identifier for serialization or indexing.
Attributes
- Companion
- object
- Source
- JvmType.scala
- Supertypes
- Known subtypes
Companion enumerating all 8 JVM primitive types plus the AnyRef fallback for reference types. Also contains JvmType.Infer, the type-class that maps Scala types to their JvmType at compile time.
Companion enumerating all 8 JVM primitive types plus the AnyRef fallback for reference types. Also contains JvmType.Infer, the type-class that maps Scala types to their JvmType at compile time.
Attributes
- Companion
- class
- Source
- JvmType.scala
- Supertypes
- Self type
-
JvmType.type
JVM-only factory methods for constructing Reader instances backed by NIO ByteBuffers and ReadableByteChannels.
JVM-only factory methods for constructing Reader instances backed by NIO ByteBuffers and ReadableByteChannels.
Attributes
- Source
- NioReaders.scala
- Supertypes
- Self type
-
NioReaders.type
JVM-only convenience constructors for creating Sink instances that write to NIO ByteBuffers and WritableByteChannels.
JVM-only convenience constructors for creating Sink instances that write to NIO ByteBuffers and WritableByteChannels.
Each method creates a sink that drains the stream into the corresponding NIO target.
Attributes
- Source
- NioSinks.scala
- Supertypes
- Self type
-
NioSinks.type
JVM-only convenience constructors for creating Stream instances backed by NIO ByteBuffers and ReadableByteChannels.
JVM-only convenience constructors for creating Stream instances backed by NIO ByteBuffers and ReadableByteChannels.
Each method wraps an NIO source as a Stream.
Attributes
- Source
- NioStreams.scala
- Supertypes
- Self type
-
NioStreams.type
JVM-only factory methods for constructing Writer instances backed by NIO ByteBuffers and WritableByteChannels.
JVM-only factory methods for constructing Writer instances backed by NIO ByteBuffers and WritableByteChannels.
Attributes
- Source
- NioWriters.scala
- Supertypes
- Self type
-
NioWriters.type
Companion object for Pipeline. Provides factory constructors for common transformations: map, filter, take, drop, collect, and identity.
Companion object for Pipeline. Provides factory constructors for common transformations: map, filter, take, drop, collect, and identity.
Attributes
- Companion
- class
- Source
- Pipeline.scala
- Supertypes
- Self type
-
Pipeline.type
A transformation from a Stream[_, In] to a Stream[_, Out]. Pipelines compose sequentially via andThen (with Pipeline.identity as the identity) and can be applied to Streams via applyToStream or to Sinks via applyToSink.
A transformation from a Stream[_, In] to a Stream[_, Out]. Pipelines compose sequentially via andThen (with Pipeline.identity as the identity) and can be applied to Streams via applyToStream or to Sinks via applyToSink.
Type parameters
- In
-
Input element type.
- Out
-
Output element type.
Attributes
- Companion
- object
- Source
- Pipeline.scala
- Supertypes
Attributes
- Companion
- trait
- Source
- Platform.scala
- Supertypes
- Self type
-
Platform.type
Cross-platform abstraction for thread management in the streams module.
Cross-platform abstraction for thread management in the streams module.
Platform-specific implementations are provided in:
- jvm/src/main/scala/zio/blocks/streams/PlatformSpecific.scala (JVM)
- js/src/main/scala/zio/blocks/streams/PlatformSpecific.scala (JS)
On the JVM, startVirtualThread launches a virtual thread (JDK 21+, detected via reflection) or a raw daemon thread as fallback. On Scala.js there is no concurrency, so supportsConcurrency is false and startVirtualThread throws UnsupportedOperationException.
createBufferedReader is a factory that returns a platform-appropriate buffered reader: concurrent on JVM, synchronous prefetch on JS.
Attributes
- Companion
- object
- Source
- Platform.scala
- Supertypes
- Known subtypes
-
trait PlatformSpecificobject Platform
JVM implementation of the cross-platform Platform capabilities.
JVM implementation of the cross-platform Platform capabilities.
Mixed into the package-level Platform object on JVM, so call sites use the same Platform.* surface regardless of platform.
supportsConcurrencyistrue.startVirtualThreadusesThread.ofVirtual().start(...)reflectively when running on JDK 21+, falling back to a daemonThreadotherwise.createBufferedReader,createMergeReader, andcreateMapParReaderreturn primitive-specialized readers (Int / Long / Float / Double) when the upstream'sJvmTypeallows it, and the generic AnyRef variants otherwise.
Attributes
- Source
- PlatformSpecific.scala
- Supertypes
- Known subtypes
-
object Platform
A consumer of elements of type A that may fail with E and, on completion, produces a result Z. Sinks are consumed by passing them to Stream.runAsync (or a platform-specific terminal): the stream compiles into a io.Reader and drains it once to produce the final result.
A consumer of elements of type A that may fail with E and, on completion, produces a result Z. Sinks are consumed by passing them to Stream.runAsync (or a platform-specific terminal): the stream compiles into a io.Reader and drains it once to produce the final result.
Type parameters
- A
-
Input element type (contravariant).
- E
-
Error type.
- Z
-
Result type.
Attributes
- Companion
- object
- Source
- Sink.scala
- Supertypes
Companion object for Sink. Provides factory constructors for common consumers: fail, create, drain, count, collectAll, foldLeft, foreach, head, last, take, exists, forall, find, fromOutputStream, fromJavaWriter, sumInt, sumLong, sumFloat, and sumDouble.
Companion object for Sink. Provides factory constructors for common consumers: fail, create, drain, count, collectAll, foldLeft, foreach, head, last, take, exists, forall, find, fromOutputStream, fromJavaWriter, sumInt, sumLong, sumFloat, and sumDouble.
Attributes
- Companion
- class
- Source
- Sink.scala
- Supertypes
- Self type
-
Sink.type
Attributes
- Source
- SinkCompanionPlatformSpecific.scala
- Supertypes
- Known subtypes
-
object Sink
A lazy, pull-based, resource-safe sequence of elements of type A that may fail with an error of type E.
A lazy, pull-based, resource-safe sequence of elements of type A that may fail with an error of type E.
A Stream is a ''description'': nothing executes until a terminal operation is driven. Cross-platform terminals such as runAsync, runCollectAsync, and headAsync return Async[Either[E, Z]]. The JVM additionally provides blocking terminals such as run, runCollect, and head, which return Either[E, Z]. Left contains typed stream errors; defects fail the outer Async or propagate from a JVM blocking terminal.
Type parameters
- A
-
Element type.
- E
-
Error type.
Attributes
- Companion
- object
- Source
- Stream.scala
- Supertypes
Companion object for Stream. Provides factory constructors:
Companion object for Stream. Provides factory constructors:
- '''Values''':
Stream.succeed, fail, empty, die - '''Collections''': fromChunk, fromIterable, apply(as: A*)
- '''Ranges''': range, fromRange
- '''Generators''': repeat, unfold
- '''Side-effects''': eval, attemptEval, attempt, defer
- '''I/O''': fromInputStream, fromJavaReader
- '''Resources''': fromAcquireRelease, fromResource
- '''Advanced''':
Stream.fromReader, suspend, flattenAll
Attributes
- Companion
- class
- Source
- Stream.scala
- Supertypes
- Self type
-
Stream.type
Attributes
- Source
- StreamPlatformSpecific.scala
- Supertypes
- Known subtypes
-
- Self type
-