Documentation ¶
Index ¶
- func AsyncCall(caller AsyncCaller, callback base.Callback, f func(), checking ...func() bool)
- func AsyncCallDelay(caller AsyncCaller, callback base.Callback, delay time.Duration, f func(), ...)
- func GoCall(caller AsyncCaller, callback base.Callback, f func(), checking ...func() bool)
- func GoCall2(callback base.Callback, f func(), checking ...func() bool)
- func SyncByHandler(handler AsyncHandler, impl func(), timeout time.Duration) base.Result
- func SyncByHandlerD(handler AsyncHandler, impl func() any, timeout time.Duration) (base.Result, any)
- func SyncCall(impl func(callback base.Callback), timeout time.Duration) base.Result
- func SyncCloseByHandler(handler AsyncHandler, impl func(), timeout time.Duration) base.Result
- type AsyncCaller
- type AsyncHandler
- type AsyncWorker
- func (w *AsyncWorker) IsCurrentInWorker() bool
- func (w *AsyncWorker) NotifyQuit() base.Result
- func (w *AsyncWorker) Post(f func()) base.Result
- func (w *AsyncWorker) PostDelayed(f func(), delay time.Duration) base.Result
- func (w *AsyncWorker) RunInNewThreadUntilReady() base.Result
- func (w *AsyncWorker) RunInNewThreadUntilReady2(listenPanic bool, abort bool) base.Result
- func (w *AsyncWorker) RunLoop() base.Result
- func (w *AsyncWorker) SetTaskMaxLimit(max int) *AsyncWorker
- func (w *AsyncWorker) StopUntilQuit(timeout time.Duration) base.Result
- type Sync
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncCall ¶
func AsyncCall(caller AsyncCaller, callback base.Callback, f func(), checking ...func() bool)
func AsyncCallDelay ¶
func AsyncCallDelay(caller AsyncCaller, callback base.Callback, delay time.Duration, f func(), checking ...func() bool)
func GoCall ¶
func GoCall(caller AsyncCaller, callback base.Callback, f func(), checking ...func() bool)
func SyncByHandler ¶
func SyncByHandler(handler AsyncHandler, impl func(), timeout time.Duration) base.Result
func SyncByHandlerD ¶
func SyncByHandlerD(handler AsyncHandler, impl func() any, timeout time.Duration) (base.Result, any)
func SyncCloseByHandler ¶
func SyncCloseByHandler(handler AsyncHandler, impl func(), timeout time.Duration) base.Result
Types ¶
type AsyncCaller ¶
type AsyncCaller interface { IsInited() bool GetHandler() AsyncHandler }
type AsyncHandler ¶
type AsyncWorker ¶
type AsyncWorker struct {
// contains filtered or unexported fields
}
func NewAsyncWorker ¶
func NewAsyncWorker(ownerName string) *AsyncWorker
func (*AsyncWorker) IsCurrentInWorker ¶
func (w *AsyncWorker) IsCurrentInWorker() bool
IsCurrentInWorker 当前执行(协程)是否为工作队列本身
(该方法性能不佳,不能频繁调用)
func (*AsyncWorker) PostDelayed ¶
func (w *AsyncWorker) PostDelayed(f func(), delay time.Duration) base.Result
PostDelayed 延期向工作队列投递任务
func (*AsyncWorker) RunInNewThreadUntilReady ¶
func (w *AsyncWorker) RunInNewThreadUntilReady() base.Result
RunInNewThreadUntilReady 创建一个新协程运行当前工作队列
(阻塞当前执行,直到工作队列准备就绪)
func (*AsyncWorker) RunInNewThreadUntilReady2 ¶
func (w *AsyncWorker) RunInNewThreadUntilReady2(listenPanic bool, abort bool) base.Result
func (*AsyncWorker) RunLoop ¶
func (w *AsyncWorker) RunLoop() base.Result
RunLoop 在当前协程中运行工作队列
(将阻塞当前执行,直到调用`stop`)
func (*AsyncWorker) SetTaskMaxLimit ¶
func (w *AsyncWorker) SetTaskMaxLimit(max int) *AsyncWorker
func (*AsyncWorker) StopUntilQuit ¶
func (w *AsyncWorker) StopUntilQuit(timeout time.Duration) base.Result
StopUntilQuit 通知工作队列退出
(将阻塞当前执行,直到队列中`立即型`任务都执行完并退出)
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
func (*Sync) NotifyWithData ¶
Click to show internal directories.
Click to hide internal directories.