runtime

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReturn = errors.New("return")

ErrReturn ...

Functions

This section is empty.

Types

type Actor

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

Actor ...

func (Actor) ProcessMessage

func (actor Actor) ProcessMessage(
	context context.Context,
	arguments []interface{},
	message context.Message,
) error

ProcessMessage ...

func (*Actor) SetState

func (actor *Actor) SetState(state context.State) error

SetState ...

type ActorFactory

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

ActorFactory ...

func NewActorFactory

func NewActorFactory(
	name string,
	states ParameterizedStateGroup,
	initialState context.State,
) (ActorFactory, error)

NewActorFactory ...

func (ActorFactory) CreateActor

func (factory ActorFactory) CreateActor() *Actor

CreateActor ...

func (ActorFactory) MarshalText

func (factory ActorFactory) MarshalText() (text []byte, err error)

MarshalText ...

func (ActorFactory) Name

func (factory ActorFactory) Name() string

Name ...

func (ActorFactory) String

func (factory ActorFactory) String() string

String ...

type Command

type Command interface {
	Run(context context.Context) (result interface{}, err error)
}

Command ...

type CommandGroup

type CommandGroup []Command

CommandGroup ...

func (CommandGroup) Run

func (commands CommandGroup) Run(context context.Context) (result interface{}, err error)

Run ...

type ConcurrentActor

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

ConcurrentActor ...

func (ConcurrentActor) SendMessage

func (actor ConcurrentActor) SendMessage(message context.Message)

SendMessage ...

func (ConcurrentActor) Start

func (actor ConcurrentActor) Start(context context.Context, arguments []interface{})

Start ...

type ConcurrentActorFactory

type ConcurrentActorFactory struct {
	ActorFactory
	// contains filtered or unexported fields
}

ConcurrentActorFactory ...

func NewConcurrentActorFactory

func NewConcurrentActorFactory(
	actorFactory ActorFactory,
	inboxSize int,
	dependencies Dependencies,
) ConcurrentActorFactory

NewConcurrentActorFactory ...

func (ConcurrentActorFactory) CreateActor

func (factory ConcurrentActorFactory) CreateActor() ConcurrentActor

CreateActor ...

type ConcurrentActorGroup

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

ConcurrentActorGroup ...

func NewConcurrentActorGroup

func NewConcurrentActorGroup(context context.Context) *ConcurrentActorGroup

NewConcurrentActorGroup ...

func (*ConcurrentActorGroup) RegisterActor

func (group *ConcurrentActorGroup) RegisterActor(actor context.Actor, arguments []interface{})

RegisterActor ...

func (*ConcurrentActorGroup) SendMessage

func (group *ConcurrentActorGroup) SendMessage(message context.Message)

SendMessage ...

type Context

type Context interface {
	context.Context
}

Context ...

It's used only for mock generating.

type DefaultErrorHandler

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

DefaultErrorHandler ...

func NewDefaultErrorHandler

func NewDefaultErrorHandler(writer io.Writer, exiter Exiter) DefaultErrorHandler

NewDefaultErrorHandler ...

func (DefaultErrorHandler) HandleError

func (handler DefaultErrorHandler) HandleError(err error)

HandleError ...

type Dependencies

type Dependencies struct {
	syncutils.WaitGroup
	ErrorHandler
}

Dependencies ...

type ErrorHandler

type ErrorHandler interface {
	HandleError(err error)
}

ErrorHandler ...

type Exiter

type Exiter func(code int)

Exiter ...

type ExiterInterface

type ExiterInterface interface {
	Exit(code int)
}

ExiterInterface ...

It's used only for mock generating.

type MessageGroup

type MessageGroup map[string]ParameterizedCommandGroup

MessageGroup ...

func (MessageGroup) ProcessMessage

func (messages MessageGroup) ProcessMessage(
	context context.Context,
	message context.Message,
) error

ProcessMessage ...

type ParameterizedCommandGroup

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

ParameterizedCommandGroup ...

func NewParameterizedCommandGroup

func NewParameterizedCommandGroup(
	parameters []string,
	commands CommandGroup,
) ParameterizedCommandGroup

NewParameterizedCommandGroup ...

func (ParameterizedCommandGroup) ParameterizedRun

func (parameterizedCommands ParameterizedCommandGroup) ParameterizedRun(
	ctx context.Context,
	arguments []interface{},
) (result interface{}, err error)

ParameterizedRun ...

type ParameterizedMessageGroup

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

ParameterizedMessageGroup ...

func NewParameterizedMessageGroup

func NewParameterizedMessageGroup(
	parameters []string,
	messages MessageGroup,
) ParameterizedMessageGroup

NewParameterizedMessageGroup ...

func (ParameterizedMessageGroup) ParameterizedProcessMessage

func (parameterizedMessages ParameterizedMessageGroup) ParameterizedProcessMessage(
	ctx context.Context,
	arguments []interface{},
	message context.Message,
) error

ParameterizedProcessMessage ...

type ParameterizedStateGroup

type ParameterizedStateGroup struct {
	StateGroup
	// contains filtered or unexported fields
}

ParameterizedStateGroup ...

func NewParameterizedStateGroup

func NewParameterizedStateGroup(parameters []string, states StateGroup) ParameterizedStateGroup

NewParameterizedStateGroup ...

func (ParameterizedStateGroup) ParameterizedProcessMessage

func (parameterizedStates ParameterizedStateGroup) ParameterizedProcessMessage(
	ctx context.Context,
	arguments []interface{},
	state context.State,
	message context.Message,
) error

ParameterizedProcessMessage ...

type StateGroup

type StateGroup map[string]ParameterizedMessageGroup

StateGroup ...

func (StateGroup) Contains

func (states StateGroup) Contains(state context.State) bool

Contains ...

func (StateGroup) ProcessMessage

func (states StateGroup) ProcessMessage(
	context context.Context,
	state context.State,
	message context.Message,
) error

ProcessMessage ...

type WaitGroup

type WaitGroup interface {
	syncutils.WaitGroup
}

WaitGroup ...

It's used only for mock generating.

type Writer

type Writer interface {
	io.Writer
}

Writer ...

It's used only for mock generating.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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