ReactivePlusPlus
ReactiveX implementation for C++20
|
Disposable is handle/resource passed from observable to observer via the set_upstream
method. Observer disposes this disposable when it wants to unsubscribe from observable.
More...
Classes | |
class | rpp::callback_disposable< Fn > |
Disposable invokes underlying callable on disposing. More... | |
class | rpp::composite_disposable_impl< Container > |
Disposable which can keep some other sub-disposables. When this root disposable is disposed, then all sub-disposables would be disposed too. More... | |
class | rpp::composite_disposable |
Disposable which can keep some other sub-disposables. When this root disposable is disposed, then all sub-disposables would be disposed too. More... | |
class | rpp::disposable_wrapper_impl< TDisposable > |
Main RPP wrapper over disposables. More... | |
struct | rpp::interface_disposable |
Interface of disposable. More... | |
Typedefs | |
using | rpp::disposable_wrapper = disposable_wrapper_impl<interface_disposable> |
Wrapper to keep "simple" disposable. Specialization of rpp::disposable_wrapper_impl. | |
using | rpp::composite_disposable_wrapper = disposable_wrapper_impl<interface_composite_disposable> |
Wrapper to keep "composite" disposable. Specialization of rpp::disposable_wrapper_impl. | |
Disposable is handle/resource passed from observable to observer via the set_upstream
method. Observer disposes this disposable when it wants to unsubscribe from observable.
In reactive programming, a disposable is an object that represents a resource that needs to be released or disposed of when it is no longer needed. This can include things like file handles, network connections, or any other resource that needs to be cleaned up after use. The purpose of a disposable is to provide a way to manage resources in a safe and efficient manner. By using disposables, you can ensure that resources are released in a timely manner, preventing memory leaks and other issues that can arise from resource leaks.
There are 2 main purposes of disposables:
subscribe
method or use subscribe_with_disposable
overload instead.