Documentation
¶
Index ¶
- type TaskPriority
- type Ypool
- func (this *Ypool) GetPoolMaxSize() uint32
- func (this *Ypool) SetPoolMaxSize(newPoolMaxSize uint32) uint32
- func (this *Ypool) Submit(task func()) error
- func (this *Ypool) SubmitPriority(priority TaskPriority, task func()) error
- func (this *Ypool) SubmitQueue(queueName interface{}, task func()) error
- func (this *Ypool) SubmitQueuePriority(priority TaskPriority, queueName interface{}, task func()) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskPriority ¶
type TaskPriority int
task priority type with level: None=0,Normal=1,High=2,Emergent=3
const ( //the lowest priority level,use for logging and no time requirement task None TaskPriority = iota //the normal priority for common use Normal //for high level use High //the highest priority Emergent )
type Ypool ¶
type Ypool struct {
// contains filtered or unexported fields
}
the pool manager
func (*Ypool) SetPoolMaxSize ¶
adjust pool max size min size is 4, return old pool max size
func (*Ypool) SubmitPriority ¶
func (this *Ypool) SubmitPriority(priority TaskPriority, task func()) error
submit a task with priority
func (*Ypool) SubmitQueue ¶
submit a task to pool in queue with name:queueName, equal to SubmitQueuePriority(Normal,queueName,task)
func (*Ypool) SubmitQueuePriority ¶
func (this *Ypool) SubmitQueuePriority(priority TaskPriority, queueName interface{}, task func()) error
submit a task to pool in queue with priority and queueName
Click to show internal directories.
Click to hide internal directories.