Library: Foundation
Package: Notifications
Header: Poco/AsyncObserver.h
Description
AsyncObserver notifies subscribers in a dedicated thread (as opposed to (N)Observer classes, which notify subscribers synchronously). In order to become active and process notifications, the start() method must be called.
This class is meant to be used with the NotificationCenter only. Notification processing thread can be started only once, and copying should be done before start() is called.
Inheritance
Direct Base Classes: NObserver < C, N >
All Base Classes: NObserver < C, N >
Member Summary
Member Functions: backlog, clone, disable, notify, operator =, start
Types Aliases
Handler
using Handler = typename NObserver < C, N >::Handler;
Matcher
using Matcher = typename NObserver < C, N >::Matcher;
NotificationPtr
using NotificationPtr = typename NObserver < C, N >::NotificationPtr;
Type
using Type = AsyncObserver < C, N >;
Constructors
AsyncObserver
AsyncObserver() = delete;
AsyncObserver
AsyncObserver(
const AsyncObserver & observer
);
AsyncObserver
AsyncObserver(
C & object,
Handler handler,
Matcher matcher = nullptr
);
Destructor
~AsyncObserver
~AsyncObserver();
Member Functions
backlog
virtual int backlog() const;
clone
virtual AbstractObserver * clone() const;
disable
virtual void disable();
notify
virtual void notify(
Notification * pNf
) const;
operator =
AsyncObserver & operator = (
const AsyncObserver & observer
);
start
virtual void start();