C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::flow::subscription Class Reference

Controls the flow of items from publishers to subscribers. More...

#include <subscription.hpp>

Classes

class  fwd_impl
 Default implementation for subscriptions that forward request and cancel to a listener. More...
 
class  impl
 Internal interface of a subscription. More...
 
class  impl_base
 Simple base type for all subscription implementations that implements the reference counting member functions. More...
 
class  listener
 Describes a listener to the subscription that will receive an event whenever the observer calls request or cancel. More...
 

Public Member Functions

 subscription (intrusive_ptr< impl > pimpl) noexcept
 
 subscription (subscription &&) noexcept=default
 
 subscription (const subscription &) noexcept=default
 
subscriptionoperator= (subscription &&) noexcept=default
 
subscriptionoperator= (const subscription &) noexcept=default
 
void release_later ()
 Resets this handle but releases the reference count after the current coordinator cycle.
 
void cancel ()
 Causes the publisher to stop producing items for the subscriber.
 
void request (size_t n)
 
bool valid () const noexcept
 
 operator bool () const noexcept
 
bool operator! () const noexcept
 
implptr () noexcept
 
const implptr () const noexcept
 
intrusive_ptr< implas_intrusive_ptr () const &noexcept
 
intrusive_ptr< impl > && as_intrusive_ptr () &&noexcept
 
void swap (subscription &other) noexcept
 

Detailed Description

Controls the flow of items from publishers to subscribers.

Member Function Documentation

◆ cancel()

void caf::flow::subscription::cancel ( )

Causes the publisher to stop producing items for the subscriber.

Any in-flight items may still get dispatched.

Postcondition
!valid()

◆ release_later()

void caf::flow::subscription::release_later ( )

Resets this handle but releases the reference count after the current coordinator cycle.

Postcondition
!valid()

◆ request()

void caf::flow::subscription::request ( size_t n)

Precondition
valid()

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