actor

package
v0.0.0-...-2f7b494 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor func(Context)

Actor is the bare minimum interface for an Actor

type Address

type Address interface {
	Sender
	EqualTo(Address) bool
}

Address is the address of an Actor. This is a location-independent interface that allows a client of an Actor to deliver a Message to it

type Arg

type Arg any

Arg is an argument to the instantiation of a new Actor

type Context

type Context interface {
	Spawner
	Receiver
	Address() Address
	Supervisor() Address
}

Context allows an Actor to contextually interact with the Actor System

type Factory

type Factory interface {
	New(...Arg) Actor
}

Factory is responsible for instantiating new Actors based on any provided set of Arg

type Message

type Message any

Message is the base level message passed around by the Actor System

type Receiver

type Receiver interface {
	Receive() <-chan Message
}

Receiver is a type that is capable of receiving a Message via a channel

type Sender

type Sender interface {
	Send() chan<- Message
}

Sender is a type that is capable of sending a Message via a channel

type Singleton

type Singleton Actor

Singleton is an Actor that implements Factory in such a way that it will return itself whenever New is invoked

func (Singleton) New

func (s Singleton) New(_ ...Arg) Actor

New allows a Singleton to act as a Factory of itself. Args are ignored

type Spawner

type Spawner interface {
	Spawn(Factory, ...Arg) Address
}

Spawner is a type that is capable of contextually Spawning a new Actor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL