Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor interface {
Receive(msg interface{}, response *FutureTask) error
}
Actor is any object than can receive an arbitrary message.
type ActorFn ¶
type ActorFn func(msg interface{}, response *FutureTask) error
ActorFn is a function that will be called on each message received in the inbox.
type CancelMessage ¶
type CancelMessage struct{}
CancelMessage will cause an actor to stop when processed.
type Future ¶
type Future interface {
GetResult() (interface{}, error)
}
Future promises the result of a long running job.
type FutureTask ¶
type FutureTask struct {
// contains filtered or unexported fields
}
FutureTask is the concrete implementation of a Future.
func (*FutureTask) GetResult ¶
func (f *FutureTask) GetResult() (interface{}, error)
GetResult will provide the result of the computation. If the future is not computed yet, it will block.
func (*FutureTask) Reject ¶
func (f *FutureTask) Reject(err error) error
func (*FutureTask) Resolve ¶
func (f *FutureTask) Resolve(result interface{}) error
Resolve completes the computation. Any thread or goroutine waiting for GetResult() will be unblocked.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a unique string that identifies an actor and specifies it's ancestry.
For example: /foo/pz4h1
The `ancestry` is '/'. This means the actor has no ancestors -- it's a root actor. The `name` is 'foo'. There can be multiple actors with the same name. The `id` is 'pz4h1' which uniquely identifies the actor.
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref abstracts an actor away by providing an opaque reference to it. The reference can be used to publish messages to the actor.
type System ¶
type System struct {
// contains filtered or unexported fields
}
System is the root supervisor for multiple actors.
func (*System) NewActorFromFn ¶
NewActorFromFn will add, and immediately run, a new actor within the actor system.
func (*System) NewActorFromStruct ¶
NewActorFromStruct will add, and immediately run, a new actor within the actor system.