sub<T> method
subscribe to subject option with queuegroup
Implementation
Subscription<T> sub<T>(
String subject, {
String? queueGroup,
T Function(String)? jsonDecoder,
}) {
_ssid++;
//get registered json decoder
if (T != dynamic && jsonDecoder == null) {
jsonDecoder = _getJsonDecoder();
}
var s = Subscription<T>(_ssid, subject, this,
queueGroup: queueGroup, jsonDecoder: jsonDecoder);
_subs[_ssid] = s;
if (status == Status.connected) {
_sub(subject, _ssid, queueGroup: queueGroup);
_backendSubs[_ssid] = true;
}
return s;
}