Documentation ¶
Index ¶
- func GetFunc(name string) types.FuncInterface
- func GetWorker(name string) types.Worker
- func NewFunc(strategy definition.Strategy) (types.Worker, error)
- func NewSimple(strategy definition.Strategy) (types.Worker, error)
- func Register(worker types.Worker)
- func RegisterFunc(name string, fn types.FuncInterface)
- func RegisterInst(worker types.Worker)
- func RegisterInstName(name string, worker types.Worker)
- func RegisterName(name string, worker types.Worker)
- type FuncWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunc ¶
func GetFunc(name string) types.FuncInterface
func RegisterFunc ¶
func RegisterFunc(name string, fn types.FuncInterface)
RegisterFunc registers func worker into registry which could be fetch through GetFunc(name string)
func RegisterInst ¶
RegisterInst registers an instance provided instead of its type
func RegisterInstName ¶
RegisterInstName registers an instance with given name
func RegisterName ¶
RegisterName registers specific type with specific name as key
Types ¶
type FuncWorker ¶
FuncWorker uses a func to implement a task loop. A channel is used to do notifications(ping-pong).
func (*FuncWorker) FuncExecutor ¶
func (w *FuncWorker) FuncExecutor(ctx context.Context)
func (*FuncWorker) Start ¶
func (w *FuncWorker) Start(strategyId, parameter string) error
func (*FuncWorker) Stop ¶
func (w *FuncWorker) Stop(strategyId, parameter string) error
Click to show internal directories.
Click to hide internal directories.