Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoEnableRoutinePool = errors.New("not enable routine pool, please add enableRtePool field to settings") EmptyTaskFunc = errors.New("task func is nil") )
Functions ¶
func CloseDefaultTask ¶ added in v1.2.2
func CloseDefaultTask() error
Types ¶
type LogHandlerFunc ¶ added in v1.3.2
type LogHandlerFunc func(string, ...interface{})
func (LogHandlerFunc) Printf ¶ added in v1.3.2
func (d LogHandlerFunc) Printf(format string, args ...interface{})
type Routine ¶ added in v1.3.2
type Routine struct { // MaxWorkerCount 最大worker数量, 默认是10 MaxWorkerCount int `json:"maxWorkerCount" yaml:"maxWorkerCount"` // FreeMaxLifetime 协程最大闲置时间, 默认是20分钟, 单位: 秒 FreeMaxLifetime int `json:"freeMaxLifetime" yaml:"freeMaxLifetime"` // PanicHandler panic处理器 PanicHandler func(interface{}) // Logger 日志处理器 Logger LogHandlerFunc // UseRawWhenBusy worker用尽, 使用原生协程执行 UseRawWhenBusy bool `json:"useRawGoroutine" yaml:"useRawGoroutine"` }
Routine 协程池配置.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) RawGoroutineCount ¶ added in v1.2.9
RawGoroutineCount 获取当前执行任务的原生协程数.
Click to show internal directories.
Click to hide internal directories.