SharedClientNotifications class

Fans a client's notifications out to several listeners.

Client.onNotification keeps one handler per method — registering a second one silently replaces the first. That was harmless while every consumer had its own client. Once one connection per device is shared, it is not: a device's own screen registering for notifications/resources/updated took the slot from the composed tile listening on the same link, and the tile stopped receiving updates for good. Closing the screen did not give it back — the registration was not lost, its owner had changed.

Nothing in the failure is visible: the subscription is still live on the device, the socket is still up, and pressing the page's own Subscribe moves the reading exactly one step, because that step is the read the subscribe action performs — not an update.

So the client is registered once per method here, and every listener gets a copy. Registrations hang off the client (an Expando) so they are shared without threading a registry through, and disappear with it.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

add(Client client, String method, Future<void> handler(Map<String, dynamic> params)) → void Function()
Adds handler for method and returns a function that removes it.
countFor(Client client, String method) int
How many listeners method currently has. For tests and diagnostics.