userver: concurrent::AsyncEventSubscriberScope Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
concurrent::AsyncEventSubscriberScope Class Referencefinal

Manages the subscription to events from an AsyncEventSource. More...

#include <userver/concurrent/async_event_source.hpp>

Public Member Functions

template<typename... Args>
 AsyncEventSubscriberScope (AsyncEventSource< Args... > &channel, FunctionId id)
 
 AsyncEventSubscriberScope (AsyncEventSubscriberScope &&scope) noexcept
 
AsyncEventSubscriberScopeoperator= (AsyncEventSubscriberScope &&other) noexcept
 
void Unsubscribe () noexcept
 

Detailed Description

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 66 of file async_event_source.hpp.

Constructor & Destructor Documentation

◆ AsyncEventSubscriberScope()

template<typename... Args>
concurrent::AsyncEventSubscriberScope::AsyncEventSubscriberScope ( AsyncEventSource< Args... > &  channel,
FunctionId  id 
)
inline

Definition at line 71 of file async_event_source.hpp.

Member Function Documentation

◆ Unsubscribe()

void concurrent::AsyncEventSubscriberScope::Unsubscribe ( )
noexcept

Unsubscribes manually. The subscription should be cancelled before anything that the callback needs is destroyed.


The documentation for this class was generated from the following file: