SelectFiber

Constructors

this
this(EpollSelectDispatcher epoll, Fiber fiber)

Constructor

this
this(EpollSelectDispatcher epoll, void delegate() coroutine)

Constructor

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

Constructor

Members

Functions

clear
bool clear()

Clears the current client; usually called from the client finalizer.

isRegistered
bool isRegistered(ISelectClient client)

Checks if client is identical to the current client. Note that the client instance is compared, not the client conduit, file descriptor or events.

register
bool register(ISelectClient client)

Registers client in epoll and sets client to the current client.

registered_client
ISelectClientInfo registered_client()
reset
void reset(Fiber fiber)

Allows to change underlying core.thread.Fiber instance. Unregisters the ISelectClient if necessary.

unregister
bool unregister()

Unegisters the current client from epoll and clears it, if any.

Variables

epoll
EpollSelectDispatcher epoll;

Epoll instance to use

Inherited Members

From MessageFiber

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.

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

Alias for fiber state

KilledException
class KilledException

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

ResumeException
class ResumeException

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

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

~this
~this()

Destructor

addToList
void addToList()

Adds this fiber to the linked list of Fibers

start
Message start(Message msg)

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

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.

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

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

kill
void kill(istring file, long line)

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

waiting
bool waiting()
running
bool running()
finished
bool finished()
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

state
State state()
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.

reset
void reset(Fiber fiber)

Allows to change underlying core.thread.Fiber instance

Meta