Chuyển tới nội dung chính

beam_stream

beam_stream delivers a request's frames to whoever is listening on its channel.

beam_stream = { path = "../riverbeam/crates/beam_stream" }
ItemRole
BeamStreamnew(transport), with_config(transport, StreamConfig), publish_event(session, request, frame), flush(session, request), stream_key(session, request)
StreamConfigpublish_chunk_token_threshold, publish_chunk_max_chars; both 0 by default
StreamTransportTrait: publish(channel, frame)
NatsTransportconnect(url), new(bus), with_prefix(bus, prefix), subscribe(channel), subject(channel)
BroadcastTransportnew(capacity), subscribe(); default capacity 1024
InMemoryTransportnew(), frames()
PublishedFramechannel and frame
subject_for_channel, DEFAULT_STREAM_PREFIXNATS subject naming (beam.stream)

async-nats is always compiled; there are no feature flags.

Channels, frame types and an SSE relay are in Streaming.