Documentation ¶
Index ¶
- func Go(ctx context.Context, fn func())
- func GoWithParams(ctx context.Context, fn func(ctx context.Context, ps ...interface{}), ...)
- func GoWithRecover(ctx context.Context, fn func(c context.Context))
- func GoWithSignal(ctx context.Context, fn func()) chan interface{}
- func New(name string, fn Callback, params []interface{})
- func NewSimple(name string, f func())
- type Callback
- type TaskChanObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoWithParams ¶
func GoWithParams(ctx context.Context, fn func(ctx context.Context, ps ...interface{}), params ...interface{})
Go 启动写的协程
func GoWithRecover ¶
GoWithRecover 常驻协程,不死不灭。协程崩溃后,记录日志,并自动拉起 主要用于主进程不结束,该方法启动的协程不结束。 ctx 参数要带一些 value,标记启动的时机,业务。方便log输出
func GoWithSignal ¶
GoWithSignal 开启一个新的协程,并且返回一个channel,用于反馈执行结果 0 表示执行成功;其他失败;
Types ¶
Click to show internal directories.
Click to hide internal directories.