subscribe method

Future<void> subscribe(
  1. String destination,
  2. StompMessageHandler handler
)

Implementation

Future<void> subscribe(
  String destination,
  StompMessageHandler handler,
) async {
  _handlers[destination] = handler;
  final id = _subscriptionsMap.length.toString();
  _subscriptionsMap[destination] = id;
  _tcpClient.add(ClientFrame.subscribe(destination, id).toBytes());
}