sync

package
v0.0.0-...-6113c70 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShardJob

type ShardJob interface {
	Source() uint32
}

type ShardWorkerPool

type ShardWorkerPool interface {
	Init()

	Shard(source uint32) uint32

	Offer(job ShardJob, block bool)
}

func NewShardWokerPool

func NewShardWokerPool(size int, numShards int, workerFunc WorkerFunc) (ShardWorkerPool, error)

type WorkerFunc

type WorkerFunc func(shard int, jobCh <-chan interface{})

type WorkerPool

type WorkerPool interface {
	Schedule(task func())

	ScheduleAlways(task func())

	ScheduleAuto(task func())
}

func NewWorkerPool

func NewWorkerPool(size int) WorkerPool

Jump to

Keyboard shortcuts

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