subscribe method

  1. @override
TransportSubscription subscribe(
  1. String subject,
  2. void onMessage(
    1. 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);
}