subscribe method
TransportSubscription
subscribe(
- String subject,
- void onMessage(
- TransportMessage message
override
Registers a subscription. When the connection is down the subscription is remembered and established after the next successful connection.
Implementation
@override
TransportSubscription subscribe(
String subject,
void Function(TransportMessage message) onMessage,
) {
final registration = _FakeRegistration(_nextId++, subject, onMessage);
_registrations.add(registration);
return _FakeSubscription(registration);
}