Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalQueue ¶
type LocalQueue struct {
// contains filtered or unexported fields
}
func NewLocalQueue ¶
func NewLocalQueue(goNum int, queueSize int, stopCh <-chan struct{}) *LocalQueue
func (*LocalQueue) Add ¶
func (localQueue *LocalQueue) Add(task *Task)
type SyncQueue ¶
type SyncQueue struct {
// contains filtered or unexported fields
}
Synchronous FIFO queue
func (*SyncQueue) Close ¶
func (q *SyncQueue) Close()
Close SyncQueue
After close, Pop will return nil without block, and TryPop will return v=nil, ok=True
func (*SyncQueue) Pop ¶
func (q *SyncQueue) Pop() (v interface{})
Pop an item from SyncQueue, will block if SyncQueue is empty
type Task ¶
type Task struct { Context interface{} HandleFunc TaskHandleFunc }
func NewTask ¶
func NewTask(context interface{}, handleFunc TaskHandleFunc) *Task
type TaskHandleFunc ¶
type TaskHandleFunc func(context interface{})
Click to show internal directories.
Click to hide internal directories.