an issue with how the cleanup function is defined in the SubscriberFunction is that the SubscriberFunction must return the function. This is problematic if the SubscriberFunction blocks the execution for too long until it receives the cleanup function.
In RxJava, we can solve this by replacing the internal cancellable/disposable state of the Emitter (SubscriptionObserver) by calling setDisposable(Disposable) or setCancellable(Cancellable).
an issue with how the cleanup function is defined in the SubscriberFunction is that the SubscriberFunction must return the function. This is problematic if the SubscriberFunction blocks the execution for too long until it receives the cleanup function.
In RxJava, we can solve this by replacing the internal cancellable/disposable state of the Emitter (SubscriptionObserver) by calling
setDisposable(Disposable)
orsetCancellable(Cancellable)
.