#include <userver/concurrent/async_event_source.hpp>
Manages the subscription to events from an AsyncEventSource.
Removes the associated listener automatically on destruction.
The Scope is usually placed as a member in the subscribing object. Unsubscribe
should be called manually in the objects destructor, before anything that the callback needs is destroyed.
Definition at line 68 of file async_event_source.hpp.
Public Member Functions | |
template<typename... Args> | |
AsyncEventSubscriberScope (AsyncEventSource< Args... > &channel, FunctionId id) | |
AsyncEventSubscriberScope (AsyncEventSubscriberScope &&scope) noexcept | |
AsyncEventSubscriberScope & | operator= (AsyncEventSubscriberScope &&other) noexcept |
void | Unsubscribe () noexcept |
|
inline |
Definition at line 73 of file async_event_source.hpp.
|
noexcept |
Unsubscribes manually. The subscription should be cancelled before anything that the callback needs is destroyed.