gxsync

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 9 Imported by: 46

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskPool

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

task pool: manage task ts

func NewTaskPool

func NewTaskPool(opts ...TaskPoolOption) *TaskPool

build a task pool

func (*TaskPool) AddTask

func (p *TaskPool) AddTask(t task) (ok bool)

AddTask wait idle worker add task return false when the pool is stop

func (*TaskPool) AddTaskAlways added in v1.7.0

func (p *TaskPool) AddTaskAlways(t task)

AddTaskAlways add task to queues or do it immediately

func (*TaskPool) AddTaskBalance added in v1.7.0

func (p *TaskPool) AddTaskBalance(t task)

AddTaskBalance add task to idle queue do it immediately when no idle queue

func (*TaskPool) Close

func (p *TaskPool) Close()

func (*TaskPool) IsClosed

func (p *TaskPool) IsClosed() bool

check whether the session has been closed.

type TaskPoolOption

type TaskPoolOption func(*TaskPoolOptions)

func WithTaskPoolTaskPoolSize

func WithTaskPoolTaskPoolSize(size int) TaskPoolOption

@size is the task queue pool size

func WithTaskPoolTaskQueueLength

func WithTaskPoolTaskQueueLength(length int) TaskPoolOption

@length is the task queue length

func WithTaskPoolTaskQueueNumber

func WithTaskPoolTaskQueueNumber(number int) TaskPoolOption

@number is the task queue number

type TaskPoolOptions

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

Jump to

Keyboard shortcuts

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