poolmanager

package
v1.1.0-beta.0...-9958228 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meta

type Meta struct {
	// contains filtered or unexported fields
}

Meta is a container that can control or watch the task in the pool.

func NewMeta

func NewMeta(taskID uint64, exitCh chan struct{}, taskCh chan func(), concurrency int32) *Meta

NewMeta create a new meta.

func (*Meta) DecTask

func (m *Meta) DecTask()

DecTask is to minus running task count.

func (*Meta) GetExitCh

func (m *Meta) GetExitCh() chan struct{}

GetExitCh is to get the exit channel.

func (*Meta) GetTaskCh

func (m *Meta) GetTaskCh() chan func()

GetTaskCh is to get the task channel.

func (*Meta) IncTask

func (m *Meta) IncTask()

IncTask is to add running task count.

func (*Meta) TaskID

func (m *Meta) TaskID() uint64

TaskID is to get the task id.

type TaskManager

type TaskManager struct {
	// contains filtered or unexported fields
}

TaskManager is a manager that can control or watch the pool.

func NewTaskManager

func NewTaskManager(c int32) TaskManager

NewTaskManager create a new pool task manager.

func (*TaskManager) DeleteTask

func (t *TaskManager) DeleteTask(taskID uint64)

DeleteTask delete a task from the manager.

func (*TaskManager) Downclock

func (t *TaskManager) Downclock()

Downclock is to decrease the concurrency of pool.

func (*TaskManager) GetOriginConcurrency

func (t *TaskManager) GetOriginConcurrency() int32

GetOriginConcurrency return the concurrency of the pool at the init.

func (*TaskManager) Overclock

func (t *TaskManager) Overclock() (tid uint64, task *Meta)

Overclock is to increase the concurrency of pool.

func (*TaskManager) RegisterTask

func (t *TaskManager) RegisterTask(task *Meta)

RegisterTask register a task to the manager.

type TaskStatusContainer

type TaskStatusContainer struct {
	// contains filtered or unexported fields
}

TaskStatusContainer is a container that can control or watch the pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL