unsubscribe method
void
unsubscribe()
stop receiving messages for this channel
Implementation
void unsubscribe() {
final callback = onUnsubscribed;
final unsubscribeParameters = jsonEncode({
'identifier': identifier,
'command': 'unsubscribe'
});
/// ask the subscriptionManager to unsubscribe so that everything is cleaned up properly
if (!_cancelledBySubscriptionManager) {
subscriptionManager.unsubscribe(this);
subscriptionManager.connection.socketChannel.sink.add(unsubscribeParameters);
state = HotlineSubscriptionRequestState.unsubscribed;
_state_controller.add(state);
} else if (callback != null) {
callback();
}
}