Documentation
¶
Overview ¶
Package runtime contains optional lifecycle, scheduling and worker helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lifecycle ¶
type Lifecycle struct {
// contains filtered or unexported fields
}
Lifecycle runs registered startup and shutdown hooks in order.
func (*Lifecycle) BeforeStart ¶
type ScheduledJob ¶
ScheduledJob describes a fixed-interval background task.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs registered jobs until its context is canceled.
func NewScheduler ¶
func NewScheduler() *Scheduler
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool limits concurrent background functions and waits for completion.
func NewWorkerPool ¶
func NewWorkerPool(size int) *WorkerPool
NewWorkerPool creates a pool with at least one worker slot.
func (*WorkerPool) Go ¶
func (p *WorkerPool) Go(fn func())
func (*WorkerPool) Wait ¶
func (p *WorkerPool) Wait()