actors

package
v0.0.0-...-d2438c5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 2 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 interface {

	// ID returns the unique ID for the actor
	ID() string

	// Types returns the underlying types the actor subscribes to
	Types() []string

	// Write pushes information to the actor
	Write([]byte) error

	// Close the actor
	Close()

	// NoForward decides if messages should be forwarded to the actor
	NoForward() bool

	// Done returns if the actor is done messaging.
	Done() bool
}

Actor defines an broker between event messages and nodes

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group holds a group of actors

func NewGroup

func NewGroup() *Group

NewGroup creates an Group with sane defaults

func (*Group) Add

func (g *Group) Add(a Actor)

Add an actor to a group

func (*Group) Prune

func (g *Group) Prune() (cleaned bool)

Prune removes any done actors

func (*Group) Remove

func (g *Group) Remove(a Actor)

Remove an actor from the group

func (*Group) Walk

func (g *Group) Walk(fn func(Actor) error) error

Walk over the actors with in the group one by one (order is not guaranteed).

Jump to

Keyboard shortcuts

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