subscribe method
Subscribes to a destination on a specific peer
Implementation
Future<StompSubscription> subscribe({
required PeerId peerId,
required String destination,
String? subscriptionId,
StompAckMode ackMode = StompAckMode.auto,
bool requestReceipt = false,
Map<String, String>? headers,
}) async {
final client = _clients[peerId];
if (client == null || !client.isConnected) {
throw StompConnectionException('No active connection to peer $peerId');
}
return await client.subscribe(
destination: destination,
id: subscriptionId,
ackMode: ackMode,
requestReceipt: requestReceipt,
headers: headers,
);
}