Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a thread-safe queue.
func (*Queue[T]) Get ¶
func (q *Queue[T]) Get() T
Get removes and returns an element from the queue. If the queue is empty, then Get will block until an element is available.
func (*Queue[T]) GetWithContext ¶
GetWithContext removes and returns an element from the queue. If the queue is empty, then Get will block until an element is available or the context is canceled. This routine is relatively expensive---don't use it for a high throughput queue. Instead, you should probably just use a channel.
Click to show internal directories.
Click to hide internal directories.