tagion.actor.actor

Actor framework implementation

Members

Aliases

CtrlMsg
alias CtrlMsg = Tuple!(string, "task_name", Ctrl, "ctrl")

Control message sent to a supervisor contains the Tid of the actor which send it and the state

Functions

control
void control(CtrlMsg msg)

Controls message sent from the children.

end
void end()

Cleanup and notify the supervisor that you have ended

fail
void fail(Throwable t)

* Send a TaskFailure up to the owner * Silently fails if there is no owner * Does NOT exit regular control flow

ownerTerminated
void ownerTerminated(OwnerTerminated )

Stops the actor if the supervisor stops

runTimeout
void runTimeout(Duration duration, void delegate() @(safe) timeout, Args args)
sendOwner
void sendOwner(T vals)

Send to the owner if there is one

setState
void setState(Ctrl ctrl)

send your state to your owner

unknown
void unknown(Variant message)

The default message handler, if it's an unknown messages it will send a FAIL to the owner.

Structs

ActorHandle
struct ActorHandle

A "reference" to an actor that may or may not be spawned, we will never know

Msg
struct Msg(string name)

Message "Atom" type

Request
struct Request(string name, ID = uint)
Undocumented in source.
Response
struct Response(string name, ID = uint)

Templates

isSpawnable
template isSpawnable(F, T...)

Stolen from std.concurrency;

Variables

isActor
enum bool isActor(A);

Checks if a type has the required members to be an actor

Examples