workerjuice

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PoolInterface added in v1.5.6

type PoolInterface interface {
	RunTaskChannel(tasks <-chan Task)
	CreateTaskChannel() <-chan Task
	CloseTaskChannel(tasks chan Task)
	Close()
	Errors() <-chan error
	Wait()
}

PoolInterface represents the interface that a worker pool should implement.

func NewPool added in v1.5.3

func NewPool(poolSize uint) PoolInterface

NewPool creates a new Pool with the specified size.

type SemaphoreInterface added in v1.5.4

type SemaphoreInterface interface {
	Acquire()
	Release()
	Wait()
}

func NewSemaphore added in v1.5.4

func NewSemaphore(concurrency int) SemaphoreInterface

type Task added in v1.5.3

type Task func() error

Task represents a task that can be added to a Pool.

Jump to

Keyboard shortcuts

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