Python class
MAXPushQueue
MAXPushQueue
class max.interfaces.MAXPushQueue(*args, **kwargs)
Bases: Protocol, Generic[PushItemType]
Protocol for a minimal, non-blocking push queue interface in MAX.
This protocol defines the contract for a queue that supports non-blocking put operations for adding items. It is generic over the item type and designed for scenarios where the caller must be immediately notified of success or failure rather than waiting for space to become available.
The protocol is intended for producer-side queue operations where immediate feedback is critical for proper flow control and error handling.
put_nowait()
put_nowait(item)
Attempt to put an item into the queue without blocking.
This method is designed to immediately fail (typically by raising an exception) if the item cannot be added to the queue at the time of the call. Unlike the traditional ‘put’ method in many queue implementations, which may block until space becomes available or the transfer is completed - this method never waits. It is intended for use cases where the caller must be notified of failure to enqueue immediately, rather than waiting for space.
-
Parameters:
-
item (PushItemType) – The item to be added to the queue.
-
Return type:
-
None
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!