Files
worker/provider.go
T

12 lines
383 B
Go
Raw Normal View History

2026-05-29 15:46:49 +00:00
package worker
// Provider dispatches tasks to the pool.
// Inject Provider into callers that only need to submit work;
// use Component at the launcher registration site.
type Provider interface {
// Dispatch queues a task. Returns false if the queue is full (backpressure).
Dispatch(task Task) bool
// Len returns the current number of tasks waiting in the queue.
Len() int
}