1.2.0 • Published 1 month ago

collect-your-stuff v1.2.0

Weekly downloads
-
License
GNU
Repository
github
Last release
1 month ago

Collect your stuff (and go)!

Data allocation and manipulation.

Modules

Classes

Members

Constants

Functions

collect-your-stuff

All of the collections available.

Version: 1.0.0
Author: Joshua Heagle joshuaheagle@gmail.com

collect-your-stuff~collectYourStuff

All methods exported from this module are encapsulated within collect-your-stuff.

Kind: inner constant of collect-your-stuff

TreeLinkerIterator

Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.

Kind: global class

Runnable

Identify a class that can be run.

Kind: global class

new Runnable(data)

Instantiate a Runnable class.

ParamType
data*

runnable.task ⇒ function

Retrieve the data which should be formed as a task.

Kind: instance property of Runnable

runnable.run() ⇒ *

Run the runnable task.

Kind: instance method of Runnable

Runnable.isRunnable(thing) ⇒ boolean

Check if a given thing is Runnable

Kind: static method of Runnable

ParamType
thing*

LinkerIterator

Class LinkerIterator returns the next value when using linkers of linked type lists.

Kind: global class

DoubleLinkerIterator

Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.

Kind: global class

ArrayIterator

Class ArrayIterator returns the next value when using elements of array type list.

Kind: global class

Stackable ⇐ Linker

Stackable represents a runnable entry in stack.

Kind: global class
Extends: Linker

new Stackable(stackData)

Create a stackable item that can be used in a stack.

ParamTypeDefaultDescription
stackDataObject{}
stackData.task*The data to be stored in this stackable
stackData.nextStackable | nullThe reference to the next stackable if any
stackData.readyboolean | functionfalseIndicate if the stackable is ready to run

stackable.task ⇒ *

Retrieve the data which should be formed as a task.

Kind: instance property of Stackable

stackable.run() ⇒ *

Run the stacked task.

Kind: instance method of Stackable

Stackable.fromArray(values, classType) ⇒ Object

Convert an array into Stackable instances, return the head and tail Stackables.

Kind: static method of Stackable

ParamTypeDefaultDescription
valuesArray[]Provide an array of data that will be converted to a chain of stackable linkers.
classTypeIsLinkerStackableProvide the type of IsLinker to use.

Stack

Store a collection of items which can only be inserted and removed from the top.

Kind: global class

new Stack(stackedList, listClass, stackableClass)

Instantiate the state with the starter stacked list.

ParamType
stackedListIterable | LinkedList
listClassIsArrayable
stackableClassStackable

stack.empty() ⇒ boolean

Return true if the stack is empty (there are no tasks in the stacked list)

Kind: instance method of Stack

stack.top() ⇒ Stackable

Take a look at the next stacked task

Kind: instance method of Stack

stack.pop() ⇒ Stackable | null

Remove the next stacked task and return it.

Kind: instance method of Stack

stack.push(stackable)

Push a stackable task to the top of the stack.

Kind: instance method of Stack

ParamTypeDescription
stackableStackable | *Add a new stackable to the top of the stack

stack.remove() ⇒ Stackable | null

Remove the next stacked task and return it.

Kind: instance method of Stack

stack.size() ⇒ number

Get the size of the current stack.

Kind: instance method of Stack

Queueable ⇐ Linker

Queueable represents a runnable entry in a queue.

Kind: global class
Extends: Linker

new Queueable(queueableData)

Create a queueable item that can be used in a queue.

ParamTypeDefaultDescription
queueableDataObject{}
queueableData.task*The data to be stored in this queueable
queueableData.nextQueueable | nullThe reference to the next queueable if any
queueableData.readyboolean | functionfalseIndicate if the queueable is ready to run

queueable.isReady ⇒ boolean

Check ready state.

Kind: instance property of Queueable

queueable.task ⇒ *

Retrieve the data which should be formed as a task.

Kind: instance property of Queueable

queueable.markCompleted(completeResponse) ⇒ completeResponse

Set this queueable as completed.

Kind: instance method of Queueable

ParamTypeDefaultDescription
completeResponseObject
completeResponse.success*trueIndicate when the task failed (use false) or give a success message
completeResponse.error*falseIndicate a task was error-free (use false) or give an error message
completeResponse.context*Provide additional data in the response

queueable.run() ⇒ completeResponse

Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.

Kind: instance method of Queueable

Queueable.fromArray(values, classType) ⇒ Object

Convert an array into Queueable instances, return the head and tail Queueables.

Kind: static method of Queueable

ParamTypeDefaultDescription
valuesArrayProvide an array of data that will be converted to a chain of queueable linkers.
classTypeIsLinkerQueueableProvide the type of IsLinker to use.

Queue

Maintain a series of queued items.

Kind: global class

new Queue(queuedList, listClass, queueableClass)

Instantiate the queue with the given queue list.

ParamTypeDescription
queuedListIterable | LinkedListGive the list of queueables to start in this queue.
listClassIsArrayable
queueableClassQueueable

queue.dequeue() ⇒ completeResponse | *

Take a queued task from the front of the queue and run it if ready.

Kind: instance method of Queue

queue.empty() ⇒ boolean

Return true if the queue is empty (there are no tasks in the queue list)

Kind: instance method of Queue

queue.enqueue(queueable)

Add a queued task to the end of the queue

Kind: instance method of Queue

ParamTypeDescription
queueableQueueableAdd a new queueable to the end of the queue

queue.peek() ⇒ Queueable

Take a look at the next queued task

Kind: instance method of Queue

queue.remove() ⇒ Queueable | null

Remove the next queued item and return it.

Kind: instance method of Queue

queue.size() ⇒ number

Get the length of the current queue.

Kind: instance method of Queue

TreeLinker ⇐ DoubleLinker

TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.

Kind: global class
Extends: DoubleLinker

new TreeLinker(settings, listClass)

Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.

ParamTypeDefaultDescription
settingsObject{}
settings.data*The data to be stored in this tree node
settings.nextTreeLinkerThe reference to the next linker if any
settings.prevTreeLinkerThe reference to the previous linker if any
settings.childrenLinkedTreeListThe references to child linkers if any
settings.parentTreeLinkerThe reference to a parent linker if any
listClassIsArrayable.<IsTreeNode>Give the type of list to use for storing the children

treeLinker.childrenFromArray(children, listClass) ⇒ LinkedTreeList | null

Create the children for this tree from an array.

Kind: instance method of TreeLinker

ParamTypeDescription
childrenArray | nullProvide an array of data / linker references to be children of this tree node.
listClassIsArrayable.<IsTreeNode>Give the type of list to use for storing the children

TreeLinker.fromArray(values, classType) ⇒ Object

Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.

Kind: static method of TreeLinker

ParamTypeDefaultDescription
valuesArray[]Provide an array of data that will be converted to a chain of tree-linkers.
classTypeIsTreeNodeTreeLinkerProvide the type of IsTreeNode to use.

LinkedTreeList ⇐ DoublyLinkedList

LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation.

Kind: global class
Extends: DoublyLinkedList

new LinkedTreeList()

Create the new LinkedTreeList instance, configure the list class.

linkedTreeList.list ⇒ TreeLinker

Retrieve a copy of the innerList used.

Kind: instance property of LinkedTreeList
Overrides: list

linkedTreeList.first ⇒ TreeLinker

Retrieve the first TreeLinker in the list.

Kind: instance property of LinkedTreeList
Overrides: first

linkedTreeList.last ⇒ TreeLinker

Retrieve the last TreeLinker in the list.

Kind: instance property of LinkedTreeList
Overrides: last

linkedTreeList.length ⇒ number

Return the length of the list.

Kind: instance property of LinkedTreeList
Overrides: length

linkedTreeList.parent ⇒ TreeLinker

Get the parent of this tree list.

Kind: instance property of LinkedTreeList

linkedTreeList.parent

Set the parent of this tree list

Kind: instance property of LinkedTreeList

ParamTypeDescription
parentTreeLinkerThe new node to use as the parent for this group of children

linkedTreeList.rootParent ⇒ TreeLinker

Return the root parent of the entire tree.

Kind: instance property of LinkedTreeList

linkedTreeList.initialize(initialList) ⇒ LinkedTreeList

Initialize the inner list, should only run once.

Kind: instance method of LinkedTreeList
Overrides: initialize

ParamTypeDescription
initialListTreeLinkerGive the list of tree-linkers to start in this linked-tree-list.

linkedTreeList.setChildren(item, children)

Set the children on a parent item.

Kind: instance method of LinkedTreeList

ParamTypeDescription
itemTreeLinkerThe TreeLinker node that will be the parent of the children
childrenLinkedTreeListThe LinkedTreeList which has the child nodes to use

linkedTreeList.insertAfter(node, newNode) ⇒ LinkedTreeList

Insert a new node (or data) after a node.

Kind: instance method of LinkedTreeList
Overrides: insertAfter

ParamTypeDescription
nodeTreeLinker | *The existing node as reference
newNodeTreeLinker | *The new node to go after the existing node

linkedTreeList.insertBefore(node, newNode) ⇒ LinkedTreeList

Insert a new node (or data) before a node.

Kind: instance method of LinkedTreeList
Overrides: insertBefore

ParamTypeDescription
nodeTreeLinker | *The existing node as reference
newNodeTreeLinker | *The new node to go before the existing node

linkedTreeList.append(node, after) ⇒ TreeLinker

Add a node (or data) after the given (or last) node in the list.

Kind: instance method of LinkedTreeList
Overrides: append

ParamTypeDescription
nodeTreeLinker | *The new node to add to the end of the list
afterTreeLinkerThe existing last node

linkedTreeList.prepend(node, before) ⇒ TreeLinker

Add a node (or data) before the given (or first) node in the list.

Kind: instance method of LinkedTreeList
Overrides: prepend

ParamTypeDescription
nodeTreeLinker | *The new node to add to the start of the list
beforeTreeLinkerThe existing first node

linkedTreeList.remove(node) ⇒ TreeLinker

Remove a linker from this linked list.

Kind: instance method of LinkedTreeList
Overrides: remove

ParamTypeDescription
nodeTreeLinkerThe node we wish to remove (and it will be returned after removal)

linkedTreeList.reset() ⇒ TreeLinker

Refresh all references and return head reference.

Kind: instance method of LinkedTreeList
Overrides: reset

linkedTreeList.item(index) ⇒ TreeLinker | null

Retrieve a TreeLinker item from this list by numeric index, otherwise return null.

Kind: instance method of LinkedTreeList
Overrides: item

ParamTypeDescription
indexnumberThe integer number for retrieving a node by position.

linkedTreeList.forEach(callback, thisArg)

Be able to run forEach on this LinkedTreeList to iterate over the TreeLinker Items.

Kind: instance method of LinkedTreeList
Overrides: forEach

ParamTypeDescription
callbackforEachCallbackThe function to call for-each tree node
thisArgLinkedTreeListOptional, 'this' reference

Linker ⇐ ArrayElement

Linker represents a node in a LinkedList.

Kind: global class
Extends: ArrayElement

new Linker(nodeData)

Create the new Linker instance, provide the data and optionally give the next Linker.

ParamTypeDefaultDescription
nodeDataObject{}
nodeData.data*The data to be stored in this linker
nodeData.nextLinker | nullThe reference to the next linker if any

Linker.fromArray(values, classType) ⇒ Object

Convert an array into Linker instances, return the head and tail Linkers.

Kind: static method of Linker

ParamTypeDefaultDescription
valuesArray[]Provide an array of data that will be converted to a chain of linkers.
classTypeIsLinkerLinkerProvide the type of IsLinker to use.

LinkedList ⇐ Arrayable

LinkedList represents a collection stored as a LinkedList with next references.

Kind: global class
Extends: Arrayable

new LinkedList()

Create the new LinkedList instance.

linkedList.list ⇒ Linker

Retrieve a copy of the innerList used.

Kind: instance property of LinkedList
Overrides: list

linkedList.first ⇒ Linker

Retrieve the first Linker in the list.

Kind: instance property of LinkedList
Overrides: first

linkedList.last ⇒ Linker

Retrieve the last Linker in the list.

Kind: instance property of LinkedList
Overrides: last

linkedList.length ⇒ number

Return the length of the list.

Kind: instance property of LinkedList
Overrides: length

linkedList.initialize(initialList) ⇒ LinkedList

Initialize the inner list, should only run once.

Kind: instance method of LinkedList
Overrides: initialize

ParamTypeDescription
initialListLinker | ArrayGive the list of linkers to start in this linked-list.

linkedList.insertAfter(node, newNode) ⇒ LinkedList

Insert a new node (or data) after a node.

Kind: instance method of LinkedList
Overrides: insertAfter

ParamTypeDescription
nodeLinker | *The existing node as reference
newNodeLinker | *The new node to go after the existing node

linkedList.insertBefore(node, newNode) ⇒ LinkedList

Insert a new node (or data) before a node.

Kind: instance method of LinkedList
Overrides: insertBefore

ParamTypeDescription
nodeLinker | *The existing node as reference
newNodeLinker | *The new node to go before the existing node

linkedList.append(node, after) ⇒ Linker

Add a node (or data) after the given (or last) node in the list.

Kind: instance method of LinkedList
Overrides: append

ParamTypeDescription
nodeLinker | *The new node to add to the end of the list
afterLinkerThe existing last node

linkedList.prepend(node, before) ⇒ Linker

Add a node (or data) before the given (or first) node in the list.

Kind: instance method of LinkedList
Overrides: prepend

ParamTypeDescription
nodeLinker | *The new node to add to the start of the list
beforeLinkerThe existing first node

linkedList.remove(node) ⇒ Linker

Remove a linker from this linked list.

Kind: instance method of LinkedList
Overrides: remove

ParamTypeDescription
nodeLinkerThe node we wish to remove (and it will be returned after removal)

linkedList.item(index) ⇒ Linker | null

Retrieve a Linker item from this list by numeric index, otherwise return null.

Kind: instance method of LinkedList
Overrides: item

ParamTypeDescription
indexnumberThe integer number for retrieving a node by position.

linkedList.forEach(callback, thisArg) ⇒ LinkedList

Be able to run forEach on this LinkedList to iterate over the linkers.

Kind: instance method of LinkedList
Overrides: forEach

ParamTypeDescription
callbackforEachCallbackThe function to call for-each linker
thisArgLinkedListOptional, 'this' reference

DoublyLinkedList ⇐ LinkedList

DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.

Kind: global class
Extends: LinkedList

new DoublyLinkedList()

Create the new DoublyLinkedList instance.

doublyLinkedList.list ⇒ DoubleLinker

Retrieve a copy of the innerList used.

Kind: instance property of DoublyLinkedList
Overrides: list

doublyLinkedList.first ⇒ DoubleLinker

Retrieve the first DoubleLinker in the list.

Kind: instance property of DoublyLinkedList
Overrides: first

doublyLinkedList.last ⇒ DoubleLinker

Retrieve the last DoubleLinker in the list.

Kind: instance property of DoublyLinkedList
Overrides: last

doublyLinkedList.length ⇒ number

Return the length of the list.

Kind: instance property of DoublyLinkedList
Overrides: length

doublyLinkedList.initialize(initialList) ⇒ DoublyLinkedList

Initialize the inner list, should only run once.

Kind: instance method of DoublyLinkedList
Overrides: initialize

ParamTypeDescription
initialListDoubleLinkerGive the list of double-linkers to start in this doubly linked-list.

doublyLinkedList.insertAfter(node, newNode) ⇒ DoublyLinkedList

Insert a new node (or data) after a node.

Kind: instance method of DoublyLinkedList
Overrides: insertAfter

ParamTypeDescription
nodeDoubleLinker | *The existing node as reference
newNodeDoubleLinker | *The new node to go after the existing node

doublyLinkedList.insertBefore(node, newNode) ⇒ DoublyLinkedList

Insert a new node (or data) before a node.

Kind: instance method of DoublyLinkedList
Overrides: insertBefore

ParamTypeDescription
nodeDoubleLinker | *The existing node as reference
newNodeDoubleLinker | *The new node to go before the existing node

doublyLinkedList.append(node, after) ⇒ DoubleLinker

Add a node (or data) after the given (or last) node in the list.

Kind: instance method of DoublyLinkedList
Overrides: append

ParamTypeDescription
nodeDoubleLinker | *The new node to add to the end of the list
afterDoubleLinkerThe existing last node

doublyLinkedList.prepend(node, before) ⇒ DoubleLinker

Add a node (or data) before the given (or first) node in the list.

Kind: instance method of DoublyLinkedList
Overrides: prepend

ParamTypeDescription
nodeDoubleLinker | *The new node to add to the start of the list
beforeDoubleLinkerThe existing first node

doublyLinkedList.remove(node) ⇒ DoubleLinker

Remove a linker from this linked list.

Kind: instance method of DoublyLinkedList
Overrides: remove

ParamTypeDescription
nodeDoubleLinkerThe node we wish to remove (and it will be returned after removal)

doublyLinkedList.reset() ⇒ DoubleLinker

Refresh all references and return head reference.

Kind: instance method of DoublyLinkedList

doublyLinkedList.item(index) ⇒ DoubleLinker | null

Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.

Kind: instance method of DoublyLinkedList
Overrides: item

ParamTypeDescription
indexnumberThe integer number for retrieving a node by position.

doublyLinkedList.forEach(callback, thisArg)

Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.

Kind: instance method of DoublyLinkedList
Overrides: forEach

ParamTypeDescription
callbackforEachCallbackThe function to call for-each double linker
thisArgDoublyLinkedListOptional, 'this' reference

DoubleLinker ⇐ Linker

DoubleLinker represents a node in a DoublyLinkedList which is chained by next and prev.

Kind: global class
Extends: Linker

new DoubleLinker(nodeData)

Create the new DoubleLinker instance, provide the data and optionally the next and prev references.

ParamTypeDefaultDescription
nodeDataObject{}
nodeData.data*The data to be stored in this linker
nodeData.nextDoubleLinker | nullThe reference to the next linker if any
nodeData.prevDoubleLinker | nullThe reference to the previous linker if any

DoubleLinker.fromArray(values, classType) ⇒ Object

Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.

Kind: static method of DoubleLinker

ParamTypeDefaultDescription
valuesArray[]Provide an array of data that will be converted to a chain of linkers.
classTypeIsDoubleLinkerDoubleLinkerProvide the type of IsDoubleLinker to use.

Arrayable

Arrayable represents a collection stored as an array.

Kind: global class

new Arrayable()

Create the new Arrayable instance, configure the Arrayable class.

arrayable.list ⇒ Array.<ArrayElement>

Retrieve a copy of the innerList used.

Kind: instance property of Arrayable

arrayable.first ⇒ ArrayElement

Retrieve the first Element from the Arrayable

Kind: instance property of Arrayable

arrayable.last ⇒ ArrayElement

Retrieve the last Element from the Arrayable

Kind: instance property of Arrayable

arrayable.length ⇒ number

Return the length of the list.

Kind: instance property of Arrayable

arrayable.initialize(initialList) ⇒ Arrayable

Initialize the inner list, should only run once.

Kind: instance method of Arrayable

ParamTypeDescription
initialListArray.<ArrayElement>Give the array of elements to start in this Arrayable.

arrayable.insertAfter(node, newNode) ⇒ Arrayable

Insert a new node (or data) after a node.

Kind: instance method of Arrayable

ParamTypeDescription
nodeArrayElement | *The existing node as reference
newNodeArrayElement | *The new node to go after the existing node

arrayable.insertBefore(node, newNode) ⇒ Arrayable

Insert a new node (or data) before a node.

Kind: instance method of Arrayable

ParamTypeDescription
nodeArrayElement | *The existing node as reference
newNodeArrayElement | *The new node to go before the existing node

arrayable.append(node, after) ⇒ Arrayable

Add a node (or data) after the given (or last) node in the list.

Kind: instance method of Arrayable

ParamTypeDescription
nodeArrayElement | *The new node to add to the end of the list
afterArrayElementThe existing last node

arrayable.prepend(node, before) ⇒ Arrayable

Add a node (or data) before the given (or first) node in the list.

Kind: instance method of Arrayable

ParamTypeDescription
nodeArrayElement | *The new node to add to the start of the list
beforeArrayElementThe existing first node

arrayable.remove(node) ⇒ ArrayElement

Remove an element from this arrayable.

Kind: instance method of Arrayable

ParamTypeDescription
nodeArrayElementThe node we wish to remove (and it will be returned after removal)

arrayable.item(index) ⇒ ArrayElement | null

Retrieve an ArrayElement item from this list by numeric index, otherwise return null.

Kind: instance method of Arrayable

ParamTypeDescription
indexnumberThe integer number for retrieving a node by position.

arrayable.forEach(callback, thisArg) ⇒ Arrayable

Be able to run forEach on this Arrayable to iterate over the elements.

Kind: instance method of Arrayable

ParamTypeDescription
callbackforEachCallbackThe function to call for-each element
thisArgArrayableOptional, 'this' reference

ArrayElement

Element represents a node in an Arrayable.

Kind: global class

new ArrayElement(data)

Create the new Element instance, provide the data and optionally configure the type of Element.

ParamTypeDefaultDescription
data*The data to be stored in this element.

ArrayElement.fromArray(values, classType) ⇒ Object

Convert an array into Element instances, return the head and tail Elements.

Kind: static method of ArrayElement

ParamTypeDefaultDescription
valuesArray.<IsElement>[]Provide an array of data that will be converted to array of elements.
classTypeIsElementArrayElementProvide the type of IsElement to use.

Stackable ⇒ Stackable

Make a new Stackable from the data given if it is not already a valid Stackable.

Kind: global variable

ParamTypeDefaultDescription
stackableStackable | *Return a valid Stackable instance from given data, or even an already valid one.
classTypeIsLinkerStackableProvide the type of IsLinker to use.

new Stackable(stackData)

Create a stackable item that can be used in a stack.

ParamTypeDefaultDescription
stackDataObject{}
stackData.task*The data to be stored in this stackable
stackData.nextStackable | nullThe reference to the next stackable if any
stackData.readyboolean | functionfalseIndicate if the stackable is ready to run

stackable.task ⇒ *

Retrieve the data which should be formed as a task.

Kind: instance property of Stackable

stackable.run() ⇒ *

Run the stacked task.

Kind: instance method of Stackable

Stackable.fromArray(values, classType) ⇒ Object

Convert an array into Stackable instances, return the head and tail Stackables.

Kind: static method of Stackable

ParamTypeDefaultDescription
valuesArray[]Provide an array of data that will be converted to a chain of stackable linkers.
classTypeIsLinkerStackableProvide the type of IsLinker to use.

Stack ⇒ Stack

Convert an array to a Stack.

Kind: global variable

ParamTypeDescription
valuesArrayAn array of values which will be converted to stackables in this queue
stackableClassStackableThe class to use for each stackable
listClassStack | IterableThe class to use to manage the stackables

new Stack(stackedList, listClass, stackableClass)

Instantiate the state with the starter stacked list.

ParamType
stackedListIterable | LinkedList
listClassIsArrayable
stackableClassStackable

stack.empty() ⇒ boolean

Return true if the stack is empty (there are no tasks in the stacked list)

Kind: instance method of Stack

stack.top() ⇒ Stackable

Take a look at the next stacked task

Kind: instance method of Stack

stack.pop() ⇒ Stackable | null

Remove the next stacked task and return it.

Kind: instance method of Stack

stack.push(stackable)

Push a stackable task to the top of the stack.

Kind: instance method of Stack

ParamTypeDescription
stackableStackable | *Add a new stackable to the top of the stack

stack.remove() ⇒ Stackable | null

Remove the next stacked task and return it.

Kind: instance method of Stack

stack.size() ⇒ number

Get the size of the current stack.

Kind: instance method of Stack

Queueable ⇒ Queueable

Make a new Queueable from the data given if it is not already a valid Queueable.

Kind: global variable

ParamTypeDefaultDescription
queueableQueueable | *Return a valid Queueable instance from given data, or even an already valid one.
classTypeIsLinkerQueueableProvide the type of IsLinker to use.

new Queueable(queueableData)

Create a queueable item that can be used in a queue.

ParamTypeDefaultDescription
queueableDataObject{}
queueableData.task*The data to be stored in this queueable
queueableData.nextQueueable | nullThe reference to the next queueable if any
queueableData.readyboolean | functionfalseIndicate if the queueable is ready to run

queueable.isReady ⇒ boolean

Check ready state.

Kind: instance property of Queueable

queueable.task ⇒ *

Retrieve the data which should be formed as a task.

Kind: instance property of Queueable

queueable.markCompleted(completeResponse) ⇒ completeResponse

Set this queueable as completed.

Kind: instance method of Queueable

ParamTypeDefaultDescription
completeResponseObject
completeResponse.success*trueIndicate when the task failed (use false) or give a success message
completeResponse.error*falseIndicate a task was error-free (use false) or give an error message
completeResponse.context*Provide additional data in the response

queueable.run() ⇒ completeResponse

Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.

Kind: instance method of Queueable

Queueable.fromArray(values, classType) ⇒ Object

Convert an array into Queueable instances, return the head and tail Queueables.

Kind: static method of Queueable

ParamTypeDefaultDescription
valuesArrayProvide an array of data that will be converted to a chain of queueable linkers.
classTypeIsLinkerQueueableProvide the type of IsLinker to use.

Queue ⇒ Queue

Convert an array to a Queue.

Kind: global variable

ParamTypeDescription
valuesArrayAn array of values which will be converted to queueables in this queue
queueableClassQueueableThe class to use for each queueable
listClassQueue | IterableThe class to use to manage the queueables

new Queue(queuedList, listClass, queueableClass)

Instantiate the queue with the given queue list.

ParamTypeDescription
queuedListIterable | LinkedListGive the list of queueables to start in this queue.
listClassIsArrayable
queueableClassQueueable

queue.dequeue() ⇒ completeResponse | *

Take a queued task from the front of the queue and run it if ready.

Kind: instance method of Queue

queue.empty() ⇒ boolean

Return true if the queue is empty (there are no tasks in the queue list)

Kind: instance method of Queue

queue.enqueue(queueable)

Add a queued task to the end of the queue

Kind: instance method of Queue

ParamTypeDescription
queueableQueueableAdd a new queueable to the end of the queue

queue.peek() ⇒ Queueable

Take a look at the next queued task

Kind: instance method of [

1.2.0

1 month ago

1.1.9

1 month ago

1.1.8

2 months ago

1.1.7

3 months ago

1.1.6

3 months ago

1.1.5

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.1.2

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.0

6 months ago