C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
caf::resumable Class Referenceabstract

A cooperatively executed task managed by one or more instances of execution_unit. More...

#include <resumable.hpp>

Inheritance diagram for caf::resumable:
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
 Returns a subtype hint for this object.
 
virtual resume_result resume (execution_unit *, size_t max_throughput)=0
 Resume any pending computation until it is either finished or needs to be re-scheduled later.
 
virtual void intrusive_ptr_add_ref_impl ()=0
 Add a strong reference count to this object.
 
virtual void intrusive_ptr_release_impl ()=0
 Remove a strong reference count from this object.
 

Detailed Description

A cooperatively executed task managed by one or more instances of execution_unit.

Note that this class is meant as mixin for reference counted object, i.e., the subclass is required to inherit from ref_counted at some point.

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

◆ intrusive_ptr_add_ref_impl()

virtual void caf::resumable::intrusive_ptr_add_ref_impl ( )
pure virtual

Add a strong reference count to this object.

Implemented in caf::io::network::multiplexer::runnable.

◆ intrusive_ptr_release_impl()

virtual void caf::resumable::intrusive_ptr_release_impl ( )
pure virtual

Remove a strong reference count from this object.

Implemented in caf::io::network::multiplexer::runnable.

◆ resume()

virtual resume_result caf::resumable::resume ( execution_unit ,
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::io::basp::worker.

◆ subtype()

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

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::io::network::multiplexer::runnable.


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