pool

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool executes tasks in order of their deadlines, using a fixed number of goroutines. Tasks are added to the pool with a function that returns the next deadline. The pool will execute the tasks in the order of their deadlines, ensuring that tasks with earlier deadlines are executed before those with later deadlines. If a task is added while the pool is waiting for the next task, it will wake up the waiting goroutine to process the new task immediately.

func New

func New(workers int) *Pool

func (*Pool) Add

func (p *Pool) Add(fn func(context.Context) time.Time)

Jump to

Keyboard shortcuts

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