MessageFiber.suspend

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.

  1. Message suspend(Token token, Object identifier, Message msg)
    class MessageFiber
    suspend
    out (_msg_out) { auto msg_out = cast(Unqual!(typeof(_msg_out)))_msg_out; assert (msg_out.active); }
  2. Message suspend(Token token, Exception e)

Parameters

token Token

token expected to be passed to resume()

identifier Object

reference to the object causing the suspend, use null to not pass anything. The caller to resume must pass the same object reference or else a ResumeException will be thrown inside the fiber

msg Message

message to be returned by the next start()/resume() call.

Return Value

Type: Message

the message passed to the resume() call which made this call resume. Its active member may be exc; for compatibility reasons this method does not throw in this case in contrast to resume().

Throws

KilledException if the fiber is killed.

In: The fiber must be running (not waiting or finished). If the active member of msg is msg.exc, it must not be null.

Meta