Extends
Members
full :boolean
- Source:
- Inherited From:
true
if a call to put
would block.
Type:
- boolean
maxsize :Number
- Source:
- Inherited From:
The maximum number of items that can be enqueued.
Type:
- Number
size :Number
- Source:
- Inherited From:
The number of items waiting to be dequeued.
Type:
- Number
Methods
(protected) _get()
- Source:
- Overrides:
(protected) _put()
- Source:
- Inherited From:
(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}
- Source:
- Inherited From:
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()
- Source:
- Inherited From:
Get all items from the queue without waiting.
getNoWait() → {*}
- Source:
- Inherited From:
Get an item from the queue if it is not empty.
Throws:
Returns:
An item from the head of the queue.
- Type
- *
(async) join()
- Source:
- Inherited From:
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)
- Source:
- Inherited From:
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)
- Source:
- Inherited From:
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)
- Source:
- Inherited From:
Wait for an item to be available.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
QueueWaitOptions |
<optional> |