Skip to content

aea.helpers.async_friendly_queue

This module contains the implementation of AsyncFriendlyQueue.

AsyncFriendlyQueue Objects

class AsyncFriendlyQueue(queue.Queue)

queue.Queue with async_get method.

__init__

def __init__(*args: Any, **kwargs: Any) -> None

Init queue.

put

def put(item: Any, *args: Any, **kwargs: Any) -> None

Put an item into the queue.

Arguments:

  • item: item to put in the queue
  • args: similar to queue.Queue.put
  • kwargs: similar to queue.Queue.put

get

def get(*args: Any, **kwargs: Any) -> Any

Get an item into the queue.

Arguments:

  • args: similar to queue.Queue.get
  • kwargs: similar to queue.Queue.get

Returns:

similar to queue.Queue.get

async_wait

async def async_wait() -> None

Wait an item appears in the queue.

Returns:

None

async_get

async def async_get() -> Any

Wait and get an item from the queue.

Returns:

item from queue