Documentation
¶
Overview ¶
Package worker provides a background worker pool for services that need periodic or deferred work (health checks, capacity reconciliation, event firing).
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 manages background goroutines for service work.
func NewPool ¶
NewPool creates a worker pool. Background workers stop when ctx is cancelled. lcCfg controls timing: when delays are disabled, intervals fire immediately.
func (*Pool) ScheduleInterval ¶
ScheduleInterval runs fn repeatedly at the given interval. In instant mode (lifecycle delays disabled), fn is called once immediately and not repeated. Returns a cancel function.
func (*Pool) ScheduleOnce ¶
ScheduleOnce runs fn after a delay. In instant mode, fn runs immediately. Returns a cancel function.