taskpool

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 8

Documentation

Overview

Package taskpool is a generated GoMock package.

Package taskpool provides limited pool running task

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IoPool

type IoPool interface {
	Submit(IoPoolTaskArgs)
	Close()
}

func NewReadPool

func NewReadPool(threadCnt, queueDepth int, conf IoPoolMetricConf) IoPool

func NewWritePool

func NewWritePool(threadCnt, queueDepth int, conf IoPoolMetricConf) IoPool

type IoPoolMetricConf

type IoPoolMetricConf struct {
	ClusterID uint32
	DiskID    uint32
	IDC       string
	Rack      string
	Host      string
	Namespace string
	Subsystem string
	// contains filtered or unexported fields
}

type IoPoolTaskArgs

type IoPoolTaskArgs struct {
	BucketId uint64
	Tm       time.Time
	TaskFn   func()
}

type MockIoPool

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

MockIoPool is a mock of IoPool interface.

func NewMockIoPool

func NewMockIoPool(ctrl *gomock.Controller) *MockIoPool

NewMockIoPool creates a new mock instance.

func (*MockIoPool) Close

func (m *MockIoPool) Close()

Close mocks base method.

func (*MockIoPool) EXPECT

func (m *MockIoPool) EXPECT() *MockIoPoolMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIoPool) Submit

func (m *MockIoPool) Submit(arg0 IoPoolTaskArgs)

Submit mocks base method.

type MockIoPoolMockRecorder

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

MockIoPoolMockRecorder is the mock recorder for MockIoPool.

func (*MockIoPoolMockRecorder) Close

func (mr *MockIoPoolMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockIoPoolMockRecorder) Submit

func (mr *MockIoPoolMockRecorder) Submit(arg0 interface{}) *gomock.Call

Submit indicates an expected call of Submit.

type TaskPool

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

TaskPool limited pool

func New

func New(workerCount, poolSize int) TaskPool

New returns task pool with workerCount and poolSize

func (TaskPool) Close

func (tp TaskPool) Close()

Close the pool, the function is concurrent unsafe

func (TaskPool) Run

func (tp TaskPool) Run(task func())

Run add task to pool, block if pool is full

func (TaskPool) TryRun

func (tp TaskPool) TryRun(task func()) bool

TryRun try to add task to pool, return immediately

Jump to

Keyboard shortcuts

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