Skip to content

FiberStream

FiberStream is a Ruby library for linear stream processing with pull-based backpressure.

It builds lazy Source definitions, transforms values with Flow stages, and materializes results with Sink objects. Scheduler-backed and Ractor-backed boundaries are explicit, so concurrency is visible in the pipeline.

ruby
require "fiber_stream"

result =
  FiberStream::Source.each([1, 2, 3, 4])
    .map { |number| number * 2 }
    .select(&:even?)
    .take(2)
    .run_with(FiberStream::Sink.to_a)

result # => [2, 4]

Start here

  • Getting Started explains installation and the first pipeline.
  • Core Concepts defines sources, flows, sinks, and materialization.
  • Backpressure describes demand flow, async boundaries, and Ractor boundaries.

Reference

v0.4.0. Released under the MIT License.