libcaf  0.15.3
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 caf::scheduled_actor caf::io::abstract_broker caf::io::broker

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. More...
 
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. More...
 
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. More...
 
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

Denotes the state in which a resumable returned from its last call to resume.

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

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::scheduled_actor, and caf::io::abstract_broker.

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::abstract_broker, caf::scheduled_actor, and caf::io::network::multiplexer::runnable.


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