beam_stream
beam_stream delivers a request's frames to whoever is listening on its channel.
beam_stream = { path = "../riverbeam/crates/beam_stream" }
| Item | Role |
|---|---|
BeamStream | new(transport), with_config(transport, StreamConfig), publish_event(session, request, frame), flush(session, request), stream_key(session, request) |
StreamConfig | publish_chunk_token_threshold, publish_chunk_max_chars; both 0 by default |
StreamTransport | Trait: publish(channel, frame) |
NatsTransport | connect(url), new(bus), with_prefix(bus, prefix), subscribe(channel), subject(channel) |
BroadcastTransport | new(capacity), subscribe(); default capacity 1024 |
InMemoryTransport | new(), frames() |
PublishedFrame | channel and frame |
subject_for_channel, DEFAULT_STREAM_PREFIX | NATS subject naming (beam.stream) |
async-nats is always compiled; there are no feature flags.
Channels, frame types and an SSE relay are in Streaming.