Zen
A cross-platform functional programming language

RunQueue Class Reference

Implementation of run queue. More...

List of all members.

Public Member Functions

 RunQueue (Engine &engine)
 Default constructor.
void enqueFiber (Fiber::Ptr &ptr)
 Enqueue a fiber.
void processRunCtx (const Fiber::Ptr &fiber, zbl::RunContext &ctx)
 Process run context Creates a new fiber for each new continuation returned by the fcall and adds it to the runque.
int pump ()
 Pump the run queue.
void enque (RunContext &ctx)
 Enqueue fibers from run context.

Private Member Functions

 RunQueue (const RunQueue &src)
 Copy constructor.
bool dequeFiber (Fiber::Ptr &ptr)
 Dequeue a fiber.

Private Attributes

Engine_engine
 The engine.
z::queue< Fiber * > _fiberList
 The fiber list.

Detailed Description

Implementation of run queue.

Maintains a list of fibers to run. An engine can have multiple run queues


Constructor & Destructor Documentation

RunQueue ( const RunQueue src) [inline, private]

Copy constructor.

Parameters:
srcSource instance

Member Function Documentation

bool dequeFiber ( Fiber::Ptr ptr) [inline, private]

Dequeue a fiber.

Parameters:
ptrAutoptr for fiber
Returns:
True if success, else false
void enque ( RunContext ctx) [inline]

Enqueue fibers from run context.

Parameters:
ctxThe run context
void enqueFiber ( Fiber::Ptr ptr) [inline]

Enqueue a fiber.

Parameters:
ptrAutoptr for fiber
void processRunCtx ( const Fiber::Ptr fiber,
zbl::RunContext ctx 
) [inline]

Process run context Creates a new fiber for each new continuation returned by the fcall and adds it to the runque.

Parameters:
fiberBase fiber to clone for each new fiber
ctxRun context
int pump ( ) [inline]

Pump the run queue.

Returns:
0 on success, error code on error

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines