Sprites.Stream (Sprites v0.2.0)

View Source

Provides an Elixir Stream-based interface for command output.

This allows processing command output lazily and composing with other Stream operations.

Example

sprite
|> Sprites.stream("tail", ["-f", "/var/log/app.log"])
|> Stream.filter(&String.contains?(&1, "ERROR"))
|> Stream.each(&Logger.error/1)
|> Stream.run()

Summary

Functions

Creates a new stream that emits command output chunks.

Functions

new(sprite, command, args, opts)

@spec new(Sprites.Sprite.t(), String.t(), [String.t()], keyword()) :: Enumerable.t()

Creates a new stream that emits command output chunks.

The stream will emit stdout data as binary chunks. Stderr is not included in the stream (use Sprites.spawn/4 for full control).

Options

Same as Sprites.spawn/4.