Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
Context context.Context
TaskChan chan ITask
CtrChan chan struct{}
IsStopAddTask bool
StopChan chan struct{}
IoWait time.Duration
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(ctx context.Context, maxTaskNum int) *Dispatcher
func (*Dispatcher) AddTask ¶
func (d *Dispatcher) AddTask(task ITask)
func (*Dispatcher) GetIoWait ¶
func (d *Dispatcher) GetIoWait() time.Duration
func (*Dispatcher) GetStopAddTask ¶
func (d *Dispatcher) GetStopAddTask() bool
func (*Dispatcher) SetIoWait ¶
func (d *Dispatcher) SetIoWait(duration time.Duration)
func (*Dispatcher) StopAddTask ¶
func (d *Dispatcher) StopAddTask()
func (*Dispatcher) Wait ¶
func (d *Dispatcher) Wait()
type TaskPool ¶
type TaskPool struct {
Max int
// contains filtered or unexported fields
}
func NewTaskPool ¶
Click to show internal directories.
Click to hide internal directories.