Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultQueueSize = 100 DefaultCapacity = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fuse ¶
type Fuse struct {
// contains filtered or unexported fields
}
Fuse is a thread-safe one-way switch, used for permanent state changes. Implementation partially borrowed from sync.Once
type QueuePool ¶ added in v0.0.6
type QueuePool interface { Submit(key string, job func()) Drain() Kill() }
func NewQueuePool ¶ added in v0.0.6
func NewQueuePool(maxWorkers int, params QueueWorkerParams) QueuePool
type QueueWorker ¶ added in v0.0.6
type QueueWorker interface { Submit(job func()) Drain() Kill() }
func NewQueueWorker ¶ added in v0.0.6
func NewQueueWorker(params QueueWorkerParams) QueueWorker
type QueueWorkerParams ¶ added in v0.0.7
type Throttle ¶
type Throttle func(f func())
Throttle is a function throttler that takes a function as its argument. If ready, it will execute immediately, and it will always wait the specified duration between executions. If multiple functions are added within the same execution window, only the last function added will be executed.
func NewThrottle ¶
Click to show internal directories.
Click to hide internal directories.