dispatch

package
v0.0.0-...-037b315 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWorkers = 2113
	DefaultJobSize = 64
)

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, opts ...OptionFunc) schedule.Scheduler

Types

type Dispatcher

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

func (*Dispatcher) Schedule

func (d *Dispatcher) Schedule(j *schedule.Job)

type Option

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

type OptionFunc

type OptionFunc func(o *Option)

func WithMaxWorker

func WithMaxWorker(maxWorker int) OptionFunc

type Ring

type Ring struct {
	Data []*schedule.Job
	// contains filtered or unexported fields
}

func NewRing

func NewRing(size int) *Ring

func (*Ring) Push

func (q *Ring) Push(j *schedule.Job)

func (*Ring) String

func (q *Ring) String() string

type Worker

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

func NewWorker

func NewWorker(id int, jobSize int) *Worker

Jump to

Keyboard shortcuts

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