Interface nsIDirectTaskDispatcherType

The primary use of this interface is to allow any nsISerialEventTarget to provide Direct Task dispatching which is similar (but not identical to) the microtask semantics of JS promises. New direct task may be dispatched when a current direct task is running. In which case they will be run in FIFO order.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Dispatch an event for the nsISerialEventTarget, using the direct task queue.

    This function must be called from the same nsISerialEventTarget implementing direct task dispatching.

    Parameters

    • event: alreadyAddRefed_nsIRunnable

      The alreadyAddRefed<> event to dispatch.

    Returns void

  • Synchronously run any pending direct tasks queued.

    Returns void

  • Returns true if any direct tasks are pending.

    Returns bool

Generated using TypeDoc