Documentation
¶
Index ¶
- Variables
- func MergeChannels[Type any, Uint Unsigned](ctx context.Context, bufsize Uint, channels ...chan Type) <-chan Type
- func MergeChannelsIter[Type any, Uint Unsigned](ctx context.Context, bufsize Uint, channels ...chan Type) iter.Seq[Type]
- func NewPipeline[Type any](pipline Pipeline[Type]) *pipeline[Type]
- func NewPipelineContext[Type any](pipline Pipeline[Type], ctx context.Context) *pipeline[Type]
- type Func
- type HeapQueue
- type HeapQueueManager
- type IntervalJob
- type Job
- type JobList
- type Pipeline
- type Pool
- type PoolMetrics
- type PoolOption
- type Priority
- type QueueManager
- type Recoverer
- type Scheduler
- type SchedulerOption
- type Task
- type Unsigned
- type WorkerStats
- type WorkerStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // worker pool is closed ErrPoolClosed = errors.New("worker pool is closed") )
Functions ¶
func MergeChannels ¶ added in v0.0.2
func MergeChannelsIter ¶ added in v0.0.2
func NewPipeline ¶
Types ¶
type HeapQueue ¶ added in v0.0.2
type HeapQueue struct {
// contains filtered or unexported fields
}
func MustInitHeapQueue ¶ added in v0.0.2
func MustInitHeapQueue() *HeapQueue
func NewHeapQueue ¶ added in v0.0.2
type HeapQueueManager ¶ added in v0.0.2
type IntervalJob ¶ added in v0.0.2
type IntervalJob struct {
// contains filtered or unexported fields
}
func NewIntervalJob ¶ added in v0.0.2
func (*IntervalJob) Next ¶ added in v0.0.2
func (jb *IntervalJob) Next() time.Time
func (*IntervalJob) Reset ¶ added in v0.0.2
func (jb *IntervalJob) Reset()
func (*IntervalJob) Run ¶ added in v0.0.2
func (jb *IntervalJob) Run()
type JobList ¶ added in v0.0.2
type JobList []Job
func MustInitJobList ¶ added in v0.0.2
func MustInitJobList() *JobList
func NewJobList ¶ added in v0.0.2
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(opts ...PoolOption) *Pool
func NewWorkerPoolContext ¶
func NewWorkerPoolContext(ctx context.Context, opts ...PoolOption) *Pool
func (*Pool) GetMetrics ¶
func (p *Pool) GetMetrics() PoolMetrics
func (*Pool) SetMaxWorkers ¶
func (*Pool) SetMinWorkers ¶
New methods for dynamic adjustment
type PoolMetrics ¶
type PoolOption ¶
type PoolOption func(*Pool)
func WithTimeouts ¶
func WithTimeouts(up, down time.Duration) PoolOption
func WithWorkersControl ¶
func WithWorkersControl[Int constraints.Signed](min, max, init Int) PoolOption
type QueueManager ¶ added in v0.0.2
type Scheduler ¶ added in v0.0.2
type Scheduler struct {
// contains filtered or unexported fields
}
func MustInitScheduler ¶ added in v0.0.2
func MustInitScheduler(opts ...SchedulerOption) *Scheduler
func NewScheduler ¶ added in v0.0.2
func NewScheduler(opts ...SchedulerOption) (*Scheduler, error)
type SchedulerOption ¶ added in v0.0.2
type SchedulerOption func(*Scheduler)
func WithQueueManager ¶ added in v0.0.2
func WithQueueManager(QueueManager QueueManager) SchedulerOption
type WorkerStats ¶
type WorkerStatus ¶
type WorkerStatus int
const ( StatusIdle WorkerStatus = iota StatusWorking StatusTerminated )
func (WorkerStatus) String ¶
func (ws WorkerStatus) String() string
Click to show internal directories.
Click to hide internal directories.