actor

package
v0.0.0-...-7b55d8b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorInputFormat = fmt.Errorf("error input format")

Functions

func NewDaemonsClusterWithBroadcast

func NewDaemonsClusterWithBroadcast(size int, daemon Daemon) (broadcast Daemon, cluster Daemon)

Types

type Actor

type Actor interface {
	AsActorFn() ActorFn
	AsActor() Actor
	Call(ctx context.Context, in interface{}) (out interface{}, err error)
	ConnectActor(Actor) Actor
	ConnectDaemon(Daemon) Daemon
}

func NewActor

func NewActor(fn ActorFn) Actor

type ActorFn

type ActorFn func(ctx context.Context, in interface{}) (out interface{}, err error)

func (ActorFn) AsActor

func (fn ActorFn) AsActor() Actor

func (ActorFn) AsActorFn

func (fn ActorFn) AsActorFn() ActorFn

func (ActorFn) AsDaemon

func (fn ActorFn) AsDaemon() Daemon

func (ActorFn) AsDaemonFn

func (fn ActorFn) AsDaemonFn() DaemonFn

func (ActorFn) Call

func (fn ActorFn) Call(ctx context.Context, in interface{}) (out interface{}, err error)

func (ActorFn) ConnectActor

func (fn ActorFn) ConnectActor(actor Actor) Actor

func (ActorFn) ConnectDaemon

func (fn ActorFn) ConnectDaemon(daemon Daemon) Daemon

func (ActorFn) Run

func (fn ActorFn) Run(ctx context.Context) (Daemon, error)

type ActorsConnector

type ActorsConnector interface {
	Actor

	From() Actor
	To() Actor
	AsActorsConnector() ActorsConnector
}

func NewActorsConnector

func NewActorsConnector(from Actor, to Actor) ActorsConnector

type Daemon

type Daemon interface {
	AsDaemon() Daemon
	Run(ctx context.Context) (Daemon, error)
	AsDaemonFn() DaemonFn

	SetIn(chan interface{}) Daemon
	SetOut(chan interface{}) Daemon
	SetErr(chan error) Daemon

	In() chan interface{}
	Out() chan interface{}
	Err() chan error

	DisableCloseChannelsOnStop(disabled bool)
	Close()
	Stop()
	Wait()
	IsLaunched() bool
	Clone() Daemon

	ConnectActor(Actor) Daemon
	ConnectDaemon(Daemon) Daemon
}

func NewDaemon

func NewDaemon(fn DaemonFn) Daemon

func NewDaemonsCluster

func NewDaemonsCluster(size int, daemon Daemon) Daemon

func NullReaderDaemon

func NullReaderDaemon() Daemon

type DaemonFn

type DaemonFn func(ctx context.Context, in chan interface{}, out chan interface{}, err chan error) error

type DaemonsConnector

type DaemonsConnector interface {
	Daemon

	From() Daemon
	To() Daemon
	AsDaemonsConnector() DaemonsConnector
}

func NewActorDaemonConnector

func NewActorDaemonConnector(from Actor, to Daemon) DaemonsConnector

func NewDaemonActorConnector

func NewDaemonActorConnector(from Daemon, to Actor) DaemonsConnector

func NewDaemonsConnector

func NewDaemonsConnector(from Daemon, to Daemon) DaemonsConnector

type LogActor

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

func NewLogActor

func NewLogActor(logPath string) *LogActor

func (*LogActor) Close

func (l *LogActor) Close() error

func (*LogActor) LogActor

func (l *LogActor) LogActor() (Actor, error)

func (*LogActor) LogRestoreDaemon

func (l *LogActor) LogRestoreDaemon(createStruct func() interface{}) Daemon

in: nothing out: interface{} from createStruct

func (*LogActor) OpenDB

func (l *LogActor) OpenDB() error

func (*LogActor) SetDisabledWrite

func (l *LogActor) SetDisabledWrite(disabledWrite bool)

Jump to

Keyboard shortcuts

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