MessageFiber

Constructors

this
this(Fiber fiber)

Constructor

this
this(void delegate() coroutine)

Constructor

this
this(void delegate() coroutine, size_t sz)

Constructor

Destructor

~this
~this()

Destructor

Members

Aliases

Message
alias Message = SmartUnion!(Message_)
Undocumented in source.
State
alias State = Fiber.State

Alias for fiber state

Classes

KilledException
class KilledException

KilledException; thrown by suspend() when resumed by kill()

ResumeException
class ResumeException

ResumedException; thrown by suspend() when resumed with the wrong identifier

Functions

addToList
void addToList()

Adds this fiber to the linked list of Fibers

finished
bool finished()
getRawFiber
Fiber getRawFiber()

Direct read-only access to fiber that is used internally by MessageFiber. Most useful for debugging or for sanity checks in contracts.

kill
void kill(istring file, long line)

Kills the fiber coroutine. That is, resumes it and makes resume() throw a KilledException.

reset
void reset()

Resets the fiber

reset
void reset(void function() coroutine)

Resets the fiber and change the coroutine

reset
void reset(void delegate() coroutine)

Resets the fiber and change the coroutine

reset
void reset(Fiber fiber)

Allows to change underlying core.thread.Fiber instance

resume
Message resume(Token token, Object identifier, Message msg)

Resumes the fiber coroutine and waits until it is suspended or terminates.

running
bool running()
start
Message start(Message msg)

Starts the fiber coroutine and waits until it is suspended or finishes.

state
State state()
suspend
Message suspend(Token token, Object identifier, Message msg)

Suspends the fiber coroutine and waits until it is resumed or killed. If the active member of msg is msg.exc, exc will be thrown by the resuming start()/resume() call.

suspend
Message suspend(Token token, Exception e)

Suspends the fiber coroutine, makes the resuming start()/resume() call throw e and waits until the fiber is resumed or killed.

waiting
bool waiting()

Structs

Token
struct Token

Token struct passed to suspend() and resume() methods in order to ensure that the fiber is resumed for the same reason as it was suspended. The token is constructed from a string, via the static opCall() method.

Variables

fiber
Fiber fiber;

Fiber instance. (Protected but can be accessed via the public rawFiber() and reset() methods. The fiber is not simply made public, as derived classes may need to add special behaviour upon getting/setting it.)

Meta