A projection channel for StreamTransformers.
Implements AsyncIterable<T> so it can be iterated directly by
in-process consumers via run.extensions.<key>. Channels created with
StreamChannel.remote or new StreamChannel(name) are also
auto-forwarded to remote clients.
class EventLogProtocol channel name used for auto-forwarded events, if remote.
Mark the channel as complete after all buffered items are consumed.
Mark the channel as failed after all buffered items are consumed.
Return the current value of the channel.
Returns an async iterator starting at position startAt. Each call returns an independent cursor so multiple consumers can iterate the same channel concurrently.
Append an item to the channel. If this is a remote channel wired to a mux, the item is also injected into the main protocol event stream under channelName.
Creates an AsyncIterable backed by this channel, starting from startAt.
Creates a web ReadableStream that emits channel items as
Server-Sent Events. Useful for returning a channel directly from
new Response(channel.toEventStream()).
Brand-based type guard that recognises any StreamChannel
instance, even ones originating from a different copy of this
package. Prefer this over instanceof StreamChannel when code
may observe channels that were constructed elsewhere.
Create an in-process-only channel. Values remain available through
run.extensions.<key> but are not forwarded to remote clients.
Create a channel whose pushes are forwarded to remote clients under the given protocol channel name.