cancel method
Cancels the subscription: the node stops fanning events out to it and its buffer is cleared. onDone is not called; node disposal calls it.
Implementation
Future<void> cancel() async {
if (_canceled) return;
_canceled = true;
_buffer.clear();
_failQueuedRequests();
final view = _view;
_view = null;
if (view != null && !view.isClosed) {
await view.close();
}
onCancel();
}