actor-framework
Public Member Functions | Related Functions | List of all members
caf::async::execution_context Class Referenceabstract

Represents a single execution context with an internal event-loop to schedule action objects. More...

#include <execution_context.hpp>

Inheritance diagram for caf::async::execution_context:
Inheritance graph
[legend]

Public Member Functions

virtual void ref_execution_context () const noexcept=0
 Increases the reference count of the execution_context.
 
virtual void deref_execution_context () const noexcept=0
 Decreases the reference count of the execution context and destroys the object if necessary. More...
 
virtual void schedule (action what)=0
 Schedules what to run on the event loop of the execution context. More...
 
template<class F >
void schedule_fn (F &&what)
 Schedules what to run on the event loop of the execution context. More...
 
virtual void watch (disposable what)=0
 Asks the coordinator to keep its event loop running until what becomes disposed since it depends on external events or produces events that are visible to outside observers. More...
 

Related Functions

(Note that these are not member functions.)

using execution_context_ptr = intrusive_ptr< execution_context >
 
void intrusive_ptr_add_ref (const execution_context *ptr) noexcept
 
void intrusive_ptr_release (const execution_context *ptr) noexcept
 

Detailed Description

Represents a single execution context with an internal event-loop to schedule action objects.

Member Function Documentation

◆ deref_execution_context()

virtual void caf::async::execution_context::deref_execution_context ( ) const
pure virtualnoexcept

Decreases the reference count of the execution context and destroys the object if necessary.

Implemented in caf::flow::scoped_coordinator.

◆ schedule()

virtual void caf::async::execution_context::schedule ( action  what)
pure virtual

Schedules what to run on the event loop of the execution context.

This member function may get called from external sources or threads. -safe

Implemented in caf::flow::scoped_coordinator.

◆ schedule_fn()

template<class F >
void caf::async::execution_context::schedule_fn ( F &&  what)
inline

Schedules what to run on the event loop of the execution context.

This member function may get called from external sources or threads. -safe

◆ watch()

virtual void caf::async::execution_context::watch ( disposable  what)
pure virtual

Asks the coordinator to keep its event loop running until what becomes disposed since it depends on external events or produces events that are visible to outside observers.

Must be called from within the event loop of the execution context.

Implemented in caf::flow::scoped_coordinator.

Friends And Related Function Documentation

◆ execution_context_ptr

◆ intrusive_ptr_add_ref()

void intrusive_ptr_add_ref ( const execution_context ptr)
related

◆ intrusive_ptr_release()

void intrusive_ptr_release ( const execution_context ptr)
related

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