AtomicQueue

class AtomicQueue(**kwargs)

The AtomicQueue object implements a queue that can be used from multiple threads without performing any blocking operations.

Constructors

class AtomicQueue
classmethod new(initial_size: int) AtomicQueue

Create a new atomic queue instance. initial_size will be rounded up to the nearest power of 2 and used as the initial size of the queue.

Parameters:

initial_size – initial queue size

Methods

class AtomicQueue
length() int

Get the amount of items in the queue.

peek() None

Peek the head element of the queue without removing it from the queue.

pop() None

Get the head element of the queue.

push(data: None) None

Append data to the tail of the queue.

Parameters:

data – the data