Documentation ¶
Index ¶
- func CallService[S any, R any](bif Runtime, target Pid, action RpcAction[S, R]) R
- func PerformOn[S any](ctx Ingestor, target Pid, action Action[S])
- type Action
- type Ingestor
- type Logger
- type MessageActor
- type MonitorOpt
- type NamedRef
- type NormalExit
- type PanicExit
- type Pid
- type Port
- type RegisterOpt
- type RpcAction
- type RpcCall
- type Runtime
- type Start
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallService ¶
Types ¶
type Ingestor ¶
type Ingestor interface { //Tell sends m to p. If p is not alive or does not exist then the runtime will panic within this actor. Tell(p Pid, m any) }
Ingestor is capable of dispatching messages to pids
type MessageActor ¶
type MonitorOpt ¶
type NormalExit ¶
type NormalExit struct { //Who is the actor which exited Who Pid //ExitValue is the exiting value provided by the actor ExitValue any //Momento is state details Momento any }
NormalExit indicates an actor exited with a given value
type PanicExit ¶
type PanicExit struct { //Who is the actor which panicked Who Pid //Momento is the monitors momento Momento any }
PanicExit is a signal to indicate a monitored process has failed
func NewPanicExit ¶
type RegisterOpt ¶
type RegisterOpt struct {
Name string
}
type Runtime ¶
type Runtime interface { Ingestor //Self results in the Pid of the executing actor Self() Pid //Log provides a structured mechanism for producing output. Log() Logger //Spawn a new actor delegating to actor for user messages with the given option set Spawn(actor MessageActor, opts ...any) Pid //SpawnPort creates a new linked port //TODO: Is this the correct place? SpawnPort() Port //SpawnMonitor starts a new actor dispatching to actor, returning Pid. Scheduling location is up the runtime. //Deprecated: use Spawn(actor, MonitoringOpt{tell: who}) SpawnMonitor(actor MessageActor) Pid //diff between mailbox and port: port is intended for external commms, mailbox is meant for rpc like comms SpawnMailbox() Port //Monitor2 allows external monitoring between two processes Monitor2(watching Pid, watcher Pid) //Unmonitor will remove the {watched,watcher} pairs. Unmonitor(watched Pid, watcher Pid) Terminate(target Pid) Exit(result any) Register(name string, who Pid) Unregister(name string) LookupPath(path string) Pid NamedRef(name string) string SelfNamedRef() string //Context is the context of the currently invoking tick Context() context.Context }
Runtime represents the world from teh point of view of an actor. Actors must use this interface to work within the actor system.
type Start ¶
type Start struct{}
Start indicates the actor is starting execution and should perform any in actor initialization
type System ¶
type System interface { Tell(ctx context.Context, p Pid, m any) //NewPort creates a local port on the system NewPort() Port //Spawn a new actor delegating to actor for user messages with the given option set Spawn(ctx context.Context, actor MessageActor, opts ...any) Pid Lookup(ctx context.Context, absolutePath string) Pid }
System is intended to represent an entire node
Source Files ¶
Click to show internal directories.
Click to hide internal directories.