Cancels this subscription. It will no longer receive events.
May return a future which completes when the stream is done cleaning up. This can be used if the stream needs to release some resources that are needed for a following operation, for example a file being read, that should be deleted afterwards. In that case, the file may not be able to be deleted successfully until the returned future has completed.
The future will be completed with a null
value.
If the cleanup throws, which it really shouldn't, the returned future
will be completed with that error.
Returns null
if there is no need to wait.
Source
Future cancel();