Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockQueue ¶
type BlockQueue interface { /* Insert elements into the queue and block when the channel capacity is full. */ Put(ele interface{}) bool /* Insert elements into the queue. When the channel capacity is full, it will block until timeout. */ Offer(ele interface{}, timeout time.Duration) bool /* Get and remove the head element, when the channel is empty, it will block */ Take() interface{} /* Get and remove the head element, when the channel is empty, it will block until timeout */ Poll(timeout time.Duration) (interface{}, bool) /* queue len */ Len() uint32 /* queue capacity */ Cap() uint32 }
func NewBlockingQueue ¶
func NewBlockingQueue(capacity uint32) BlockQueue
Create and specify the capacity, which is actually the capacity of the channel
Click to show internal directories.
Click to hide internal directories.