
###########
ActionQueue
###########

.. js:class:: wv.Util.ActionQueue

   A queue of [Action]s to be evaluated. Some number of actions are allowed to be active at once Settable via the constructor.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wv.Util.ActionQueue.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Util.ActionQueue.isIdle`
   * :js:meth:`~wv.Util.ActionQueue.push`
   * :js:meth:`~wv.Util.ActionQueue.waitForIdle`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: wv.Util.ActionQueue.constructor

      .. rst-class:: sig-pretty-signature
      
         | ActionQueue(**maxActivePromises**\ : *number*\ , **suppressFailures**\ : *boolean*\ ): :js:class:`ActionQueue <wv.Util.ActionQueue>`
      
      Creates a new [ActionQueue]
      
      **Parameters**
      
      
         **maxActivePromises**\ : *number*
      
      
            Max number of promises to leave open before they begin getting deferred
      
      
         **suppressFailures**\ : *boolean*
      
      
            Whether or not rejected promises and actions that throw cause the queue to fail
      
      
      
      **Returns**\ : :js:class:`ActionQueue <wv.Util.ActionQueue>`
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wv.Util.ActionQueue.isIdle

      .. rst-class:: sig-pretty-signature
      
         | isIdle(): *boolean*
      
      Returns ``true`` if there are no actions waiting to be evaluated
      
      **Returns**\ : *boolean*
      
      
         Boolean indicating idle status
      
      



.. js:method:: wv.Util.ActionQueue.push

      .. rst-class:: sig-pretty-signature
      
         | push(**action**\ : :js:data:`ActionLike <wv.Util.ActionLike>`\ ): *void*
      
      Pushes a new [ActionLike] to be evaluated onto the queue
      
      **Parameters**
      
      
         **action**\ : :js:data:`ActionLike <wv.Util.ActionLike>`
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Util.ActionQueue.waitForIdle

      .. rst-class:: sig-pretty-signature
      
         | waitForIdle(): *Promise*
      
      Returns a ``Promise<void>`` that resolves when all actions have been completed or rejects if there was a failure
      
      It should be noted that if the queue is configured not to suppress failures and an action throws an error, any deferred actions (actions that were queued but not active at the time of the failure) will be cleared from the queue and will not be evaluated
      
      **Returns**\ : *Promise*
      
      
         A promise that resolves/rejects when all actions have been completed
      
      




