TopicSubscription class
Represents a topic subscription.
Constructors
-
TopicSubscription(String name, AdonisWebsok<
Websok< socket)WebSocketChannel> > - Creates a new channel subscription.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive ↔ bool
-
Determines if the subscription to the given topic is active.
getter/setter pair
-
listeners
↔ Map<
String, void Function(dynamic data)> -
Stores the listeners to the topic events.
getter/setter pair
- name → String
-
Stores the channel name.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
socket
→ AdonisWebsok<
Websok< WebSocketChannel> > -
Stores the adonis websocket instance.
final
Methods
-
close(
) → Future< bool> - Unsubscribes to the topic.
-
emit(
String event, [dynamic data = '']) → void - Emits an event to the server.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
off(
String event) → void - Remove the callback of the given event if exists.
-
on(
String event, void callback(dynamic data)) → void - Sets the callback fired when a new event is received.
-
onEventCallback(
String event, dynamic data) → void - Stores the callback than runs when a new event is received.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited