Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueClosed = errors.New("capacity queue closed")
ErrQueueClosed is returned when the queue is shut down.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter enforces concurrent execution capacity.
Semantics:
capacity > 0 → bounded capacity capacity == 0 → no capacity (reject all) capacity < 0 → unlimited capacity
func (*Limiter) Capacity ¶
Capacity returns the configured capacity limit. Returns negative values to indicate unlimited capacity.
func (*Limiter) TryAcquire ¶
TryAcquire attempts to acquire one unit of capacity. Returns true if capacity was acquired, false otherwise.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue provides FIFO (First In, First Out) waiting for capacity. When capacity becomes available, waiters are released in the order they arrived.
Click to show internal directories.
Click to hide internal directories.