Copyable, worker-safe endpoint. It owns the closed channel state, never UI captures. May outlive Scheduler: publish then returns closed. T must own its transitively immutable data; mutable aliases must not modify it. Its deleter may run on UI or any producer thread.
More...
#include <scheduler.hpp>
|
|
| Publisher ()=default |
| | Empty closed endpoint.
|
| std::expected< PublishResult, SchedulerError > | publish (std::shared_ptr< const T > value) const |
| | Transfer a strong immutable owner; null is INVALID_ARGUMENT, full is WOULD_BLOCK. No allocation occurs here. Failure changes no queue; the caller retains any other owner.
|
|
void | wake () const noexcept |
| | Wake a waiter without queueing work.
|
|
void | requestStop () const noexcept |
| | Close all publications; UI reclaims callbacks.
|
template<class T>
class portals::Publisher< T >
Copyable, worker-safe endpoint. It owns the closed channel state, never UI captures. May outlive Scheduler: publish then returns closed. T must own its transitively immutable data; mutable aliases must not modify it. Its deleter may run on UI or any producer thread.
- Template Parameters
-
| T | Transitively immutable payload type owned by shared_ptr<const T>; its deleter must support any releasing thread. |
◆ publish()
Transfer a strong immutable owner; null is INVALID_ARGUMENT, full is WOULD_BLOCK. No allocation occurs here. Failure changes no queue; the caller retains any other owner.
- Parameters
-
| value | Non-null immutable snapshot owner transferred into the bounded queue. |
- Returns
- queued or replaced on acceptance; closed for an unavailable endpoint, INVALID_ARGUMENT for null, or WOULD_BLOCK when no queue position can be used.
The documentation for this class was generated from the following file: