work

package
v0.0.0-...-d62e3dc Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDispatchTimeout = 30 * time.Second
)

Variables

View Source
var (
	ErrDoNotPostOrDispatchNilWork = errors.New("do not post or dispatch nil work")
	ErrDispatchResultNotMatch     = errors.New("dispatch result not match")
)

Functions

func DestroyMessageDispatchWork

func DestroyMessageDispatchWork(m *MessageDispatchWork)

func DestroyMessagePostWork

func DestroyMessagePostWork(m *MessagePostWork)

func Dispatch

func Dispatch(rootContext *sadefine.RootContext, pid *sadefine.PID, timeout time.Duration, work IDispatchWork) error

func Post

func Post(rootContext *sadefine.RootContext, pid *sadefine.PID, work IPostWork) error

Types

type DispatchFunc

type DispatchFunc func(ctx sadefine.Context) error

func (DispatchFunc) Execute

func (f DispatchFunc) Execute(ctx sadefine.Context) error

type IDispatchWork

type IDispatchWork interface {
	Execute(ctx sadefine.Context) error
}

type IPostWork

type IPostWork interface {
	Execute(ctx sadefine.Context)
}

type MessageDispatchWork

type MessageDispatchWork struct {
	Err  error
	Work IDispatchWork
}

func CreateMessageDispatchWork

func CreateMessageDispatchWork(work IDispatchWork) *MessageDispatchWork

type MessagePostWork

type MessagePostWork struct {
	Work IPostWork
}

func CreateMessagePostWork

func CreateMessagePostWork(work IPostWork) *MessagePostWork

type PostFunc

type PostFunc func(ctx sadefine.Context)

func (PostFunc) Execute

func (f PostFunc) Execute(ctx sadefine.Context)

Jump to

Keyboard shortcuts

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