my.actor.actor

Members

Aliases

DefaultHandler
alias DefaultHandler = void delegate(ref Actor self, ref Variant msg) @(safe) nothrow
Undocumented in source.
DownHandler
alias DownHandler = void delegate(ref Actor self, DownMsg msg) @(safe) nothrow

Actors can monitor the lifetime of other actors by sending a MonitorRequest to an address. This will cause the runtime system to send a DownMsg for other if it dies.

ErrorHandler
alias ErrorHandler = void delegate(ref Actor self, ErrorMsg) @(safe) nothrow

Actors send error messages to others by returning an error (see Errors) from a message handler. Similar to exit messages, error messages usually cause the receiving actor to terminate, unless a custom handler was installed. The default handler is used as fallback if request is used without error handler.

ExceptionHandler
alias ExceptionHandler = void delegate(ref Actor self, Exception e) @(safe) nothrow

An exception has been thrown while processing a message.

ExitHandler
alias ExitHandler = void delegate(ref Actor self, ExitMsg msg) @(safe) nothrow

Bidirectional monitoring with a strong lifetime coupling is established by calling a LinkRequest to an address. This will cause the runtime to send an ExitMsg if either this or other dies. Per default, actors terminate after receiving an ExitMsg unless the exit reason is exit_reason::normal. This mechanism propagates failure states in an actor system. Linked actors form a sub system in which an error causes all actors to fail collectively.

Classes

ScopedActorException
class ScopedActorException

The timeout triggered.

Enums

ActorState
enum ActorState
Undocumented in source.
ScopedActorError
enum ScopedActorError
Undocumented in source.

Functions

build
BuildActor build(Actor* a)
Undocumented in source. Be warned that the author may not have intended to support it.
checkMatchingCtx
void checkMatchingCtx()
Undocumented in source. Be warned that the author may not have intended to support it.
checkRefForContext
void checkRefForContext()

Check that the context parameter is ref otherwise issue a warning.

defaultErrorHandler
void defaultErrorHandler(Actor self, ErrorMsg msg)
Undocumented in source. Be warned that the author may not have intended to support it.
defaultExceptionHandler
void defaultExceptionHandler(Actor self, Exception e)
Undocumented in source. Be warned that the author may not have intended to support it.
defaultExitHandler
void defaultExitHandler(Actor self, ExitMsg msg)
Undocumented in source. Be warned that the author may not have intended to support it.
defaultHandler
void defaultHandler(Actor self, Variant msg)
Undocumented in source. Be warned that the author may not have intended to support it.
impl
Actor* impl(Actor* self, Behavior behaviors)

Implement an actor.

logAndDropHandler
void logAndDropHandler(Actor self, Variant msg)

Write the name of the actor and the message type to the console.

logExceptionHandler
void logExceptionHandler(Actor self, Exception e)
Undocumented in source. Be warned that the author may not have intended to support it.
makeAction
auto makeAction(T handler)

An behavior for an actor when it receive a message of signature.

makePromise
auto makePromise()
Undocumented in source. Be warned that the author may not have intended to support it.
makeReply
Closure!(ReplyHandler, void*) makeReply(T handler)
Undocumented in source. Be warned that the author may not have intended to support it.
makeRequest
auto makeRequest(T handler)
Undocumented in source. Be warned that the author may not have intended to support it.
scopedActor
ScopedActor scopedActor()
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Action
struct Action
Undocumented in source.
Actor
struct Actor
Undocumented in source.
Closure
struct Closure(Fn, CtxT)
Undocumented in source.
Promise
struct Promise(T)
Undocumented in source.
ReplyHandlerTimeout
struct ReplyHandlerTimeout

Timeout for an outstanding request.

Request
struct Request
Undocumented in source.
RequestResult
struct RequestResult(T)
Undocumented in source.
ScopedActor
struct ScopedActor

Intended to be used in a local scope by a user.

Meta

Authors

Joakim Brännström (joakim.brannstrom@gmx.com)