NexusRealtime class
Realtime messaging over Socket.IO. Authenticates with the API key + the current journey identity, so realtime connections join the same session.
Constructors
- NexusRealtime(NexusConfig _cfg, NexusIdentity _id)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
) → void - Open the connection (idempotent). Rooms are re-joined after a reconnect.
-
disconnect(
) → void -
emit(
String room, dynamic event, [Object? payload]) → Future -
Emit one or more named events to a room with a payload. Returns the
server's acknowledgement (
{ ok, room, recipients, related }or{ error }), which is also logged. -
join(
String room) → Future -
Join a room (first/created on the server). Re-joined automatically on
reconnect. Returns the server's acknowledgement (
{ ok, room, related }). -
leave(
String room) → Future -
Leave a room. Returns the server's acknowledgement (
{ ok }). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
off(
String event) → void - Stop listening for a server event.
-
on(
String event, NexusEventHandler handler) → void - Listen for a server event. Persisted, so it survives (re)connects and works even if called before the socket is open.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited