C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::resumable Class Referenceabstract

A cooperatively scheduled entity. More...

#include <resumable.hpp>

Inheritance diagram for caf::resumable:
caf::action::impl caf::io::network::multiplexer::runnable

Public Types

enum  resume_result {
  resume_later ,
  awaiting_message ,
  done ,
  shutdown_execution_unit
}
 Denotes the state in which a resumable returned from its last call to resume.
 
enum  subtype_t {
  unspecified ,
  scheduled_actor ,
  io_actor ,
  function_object
}
 Denotes common subtypes of resumable. More...
 

Public Member Functions

virtual subtype_t subtype () const noexcept
 Returns a subtype hint for this object.
 
virtual resume_result resume (scheduler *, size_t max_throughput)=0
 Resume any pending computation until it is either finished or needs to be re-scheduled later.
 
virtual void ref_resumable () const noexcept=0
 Add a strong reference count to this object.
 
virtual void deref_resumable () const noexcept=0
 Remove a strong reference count from this object.
 

Detailed Description

A cooperatively scheduled entity.

Member Enumeration Documentation

◆ subtype_t

Denotes common subtypes of resumable.

Enumerator
unspecified 

Identifies non-actors or blocking actors.

scheduled_actor 

Identifies event-based, cooperatively scheduled actors.

io_actor 

Identifies broker, i.e., actors performing I/O.

function_object 

Identifies tasks, usually one-shot callbacks.

Member Function Documentation

◆ deref_resumable()

virtual void caf::resumable::deref_resumable ( ) const
pure virtualnoexcept

Remove a strong reference count from this object.

Implemented in caf::action::impl, and caf::io::network::multiplexer::runnable.

◆ ref_resumable()

virtual void caf::resumable::ref_resumable ( ) const
pure virtualnoexcept

Add a strong reference count to this object.

Implemented in caf::action::impl, and caf::io::network::multiplexer::runnable.

◆ resume()

virtual resume_result caf::resumable::resume ( scheduler * ,
size_t max_throughput )
pure virtual

Resume any pending computation until it is either finished or needs to be re-scheduled later.

Implemented in caf::detail::monitor_action< F >, and caf::io::basp::worker.

◆ subtype()

resumable::subtype_t caf::resumable::subtype ( ) const
virtualnoexcept

Returns a subtype hint for this object.

This allows an execution unit to limit processing to a specific set of resumables and delegate other subtypes to dedicated workers.

Reimplemented in caf::action::impl, and caf::io::network::multiplexer::runnable.


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