Help us shape the future of Go! Take the 2026 Go Developer Survey

triggered

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventExecute added in v0.0.3

type EventExecute[PARAMS any] struct {
	// contains filtered or unexported fields
}

EventExecute封装了一个执行单元 包含执行函数,恢复函数和相关控制参数

func RegisterExecute added in v0.0.3

func RegisterExecute[PARAMS any](execDo func(params *Params[PARAMS])) *EventExecute[PARAMS]

RegisterExecute注册一个执行单元 返回分配的事件号

func (*EventExecute[PARAMS]) Notify added in v0.0.3

func (exec *EventExecute[PARAMS]) Notify(params *PARAMS)

Notify用于通知触发执行 根据事件号查找执行单元并检查通知次数 达到指定次数则触发goroutine异步执行

func (*EventExecute[PARAMS]) SetConcurrentNum added in v0.0.3

func (e *EventExecute[PARAMS]) SetConcurrentNum(v int64)

func (*EventExecute[PARAMS]) SetRecover added in v0.0.4

func (e *EventExecute[PARAMS]) SetRecover(recoverDo func(ierr any))

func (*EventExecute[PARAMS]) SetShared added in v0.0.3

func (e *EventExecute[PARAMS]) SetShared(v any)

type Params

type Params[T any] struct {
	Value  *T
	Shared *Shared
}

type Shared added in v0.0.3

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

func (*Shared) SetValue added in v0.0.3

func (s *Shared) SetValue(v any)

func (*Shared) Value added in v0.0.3

func (s *Shared) Value(do func(v any))

Jump to

Keyboard shortcuts

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