class OpenUI::Rails::Stream::Broadcaster

Binds the ordered {Bridge} to a transport and broadcasts every envelope as it is produced.

The transport is a seam: any object that responds to ‘#broadcast(envelope)` works, and {Transports} ships wrappers for Action Cable, Turbo Streams and an in-memory collector. Delivery is best effort: Action Cable and Turbo Streams do not promise order or delivery. The client applies sequence numbers and recovers from an authoritative snapshot on a gap (see the Stimulus controller).

broadcaster = Broadcaster.new(
  transport: Transports::ActionCable.new("openui:surface:42"),
  message_id: "msg-1",
  library_version: OpenUI::Rails.configuration.library_fingerprint
)
chat.complete { |chunk| broadcaster.push(chunk.content) }
broadcaster.finish