BroadcastDriver class abstract

The Broadcast Driver contract.

All transport implementations (Pusher, Ably, Soketi, etc.) must implement this interface. The driver owns the underlying connection lifecycle and vends typed channel objects to consumers.

await Echo.connect();
final channel = Echo.channel('orders');
channel.listen('OrderShipped', (event) => print(event.data));
Implementers

Constructors

BroadcastDriver()

Properties

connectionState Stream<BroadcastConnectionState>
A broadcast stream of BroadcastConnectionState transitions.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether the driver currently has an active connection.
no setter
onReconnect Stream<void>
A stream that emits once each time the driver successfully reconnects.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socketId String?
The socket identifier assigned by the server, or null when not connected.
no setter

Methods

addInterceptor(BroadcastInterceptor interceptor) → void
Registers an interceptor to be applied to all outbound and inbound messages processed by this driver.
channel(String name) BroadcastChannel
Returns a public BroadcastChannel for name.
connect() Future<void>
Establishes the connection to the broadcast server.
disconnect() Future<void>
Closes the connection and releases all resources.
join(String name) BroadcastPresenceChannel
Joins a presence channel for name and returns it.
leave(String name) → void
Unsubscribes from the channel identified by name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
private(String name) BroadcastChannel
Returns a private BroadcastChannel for name.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited