Constructor
new Queue(maxsizeopt)
- Source:
- See:
-
- Python's asyncio.Queue
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
maxsize |
Number |
<optional> |
0
|
The number of items allowed to be stored before blocking. |
Classes
Members
full :boolean
true
if a call to put
would block.
Type:
- boolean
maxsize :Number
The maximum number of items that can be enqueued.
Type:
- Number
size :Number
The number of items waiting to be dequeued.
Type:
- Number
Methods
(protected) _get()
(protected) _put()
(async) get(optionsopt) → {*}
Get an item from the queue if it is not empty. Otherwise block until an item is available.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
QueueWaitOptions |
<optional> |
Returns:
An item from the head of the queue.
- Type
- *
(async) getAll(optionsopt) → {Array}
Get all items from the queue.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
QueueWaitOptions |
<optional> |
Returns:
An array of items from the queue.
- Type
- Array
getAllNoWait()
Get all items from the queue without waiting.
getNoWait() → {*}
Get an item from the queue if it is not empty.
Throws:
Returns:
An item from the head of the queue.
- Type
- *
(async) join()
Will block until all items are dequeued and for every item that was dequeued a call
was made to
taskdone
.
(async) put(item)
Place a new item in the queue if it is not full. Otherwise block until space is
available.
Parameters:
Name | Type | Description |
---|---|---|
item |
* | Any object to pass to the caller of dequeue . |
putNoWait(item)
Place a new item in the queue if it is not full.
Parameters:
Name | Type | Description |
---|---|---|
item |
* | Any object to pass to the caller of dequeue . |
Throws:
taskDone(countopt)
Decrement the number of pending tasks. Called by consumers after completing
their use of a dequeued item to indicate that processing has finished.
When all dequeued items have been accounted for with an accompanying call to
this function
join
will unblock.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
count |
Number |
<optional> |
1
|
The number of tasks to mark as done. |
(async) wait(optionsopt)
Wait for an item to be available.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
QueueWaitOptions |
<optional> |