ruststream-sea-file runs a RustStream service over a stream file or a shell pipeline, through
sea-streamer-file and
sea-streamer-stdio. There is no server: a broker
is a .ss file on disk that survives restarts and replays, or the process's own standard input
and output.
It is the zero-infrastructure way into the framework. Handlers, routing, codecs and middleware come
from the framework; this crate is the transport.
Features
- Stream files: subscriptions follow the live tail, or replay a finished file once.
- Seeking: start at the beginning, the end, a sequence or a timestamp, and a handler moves its subscription while the service runs.
- Stdio pipelines:
producer | service | consumerin a shell, binary payloads included. - Files other tools read: a payload published without headers stays verbatim, so any
sea-streamerconsumer reads the file. - Batches assembled on the client.
- Delayed retries through a copy the runtime republishes, with retry caps and dead letters.
- AsyncAPI for both transports, behind the
asyncapifeature. - Tests without files:
TestAppruns the service's own app withFileBrokerandStdioBrokerin process.
The transport keeps no consumer positions, so acknowledgement reports AckError::Unsupported;
a service resumes from a captured position. The file transport does not run on Windows.
Install
[]
= { = "0.7", = ["macros", "json"] }
= "0.7"
= { = "1", = ["derive"] }
[]
= { = "0.7", = ["testing"] }
Write a service
use *;
use ;
async
#[ruststream::app] generates main, so the binary understands run and asyncapi gen. Each
transport has its own prelude (file, stdio).
Test it
TestApp runs the service's own app with FileBroker in process, with no file.
use TestApp;
let tb = start.await?;
tb.
.message
.to
.publish
.await?;
tb.
.subscriber
.assert_called_once;
tb.
.
.assert_called_once
.with;
TestApp::start_live(app()) runs the same test against a real stream file (just test-brokers).
Documentation
- Getting started - installation and a first service on a stream file.
- Guides - an event log on disk, resuming and seeking, shell pipelines, retries, testing and production.
- Components - one page per part of the crate: the brokers, subscriptions, positions, publishing, settlement, headers, AsyncAPI and testing.
- Architecture - how a stream file and a pipe carry messages, and where the crate sits between them and the runtime.
- Benchmarks - what the crate costs over the raw client.
- API reference - every item on docs.rs.
- The framework: https://powersemmi.github.io/ruststream/latest/
Minimum supported Rust version
The MSRV is 1.95, edition 2024.
Contributing
See CONTRIBUTING.md.
License
Licensed under the Apache-2.0 license.