Namespace: codemelted_async

codemelted_async

Implements the Async IO API collecting ways of properly doing asynchronous programming within a Deno or Web Browser runtime.
Source:

Members

(static, readonly) hardwareConcurrency :number

Identifies the number of processors to facilitate dedicated workers.
Type:
  • number
Source:

Methods

(static) sleep(params) → {Promise.<void>}

Will sleep an asynchronous task for the specified delay in milliseconds.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
delay number The specified delay in milliseconds.
Source:
Returns:
Type
Promise.<void>

(static) task(params) → {Promise.<any>}

Will process a one off asynchronous task on the main thread.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
task CAsyncTask The task to run.
data any The data to pass to the task.
delay number The specified delay in milliseconds to schedule to run the task.
Source:
Returns:
The calculated result or Error object if a failure occurred.
Type
Promise.<any>

(static) timer(params) → {CTimer}

Kicks off a timer to schedule tasks on the thread for which it is created calling the task on the interval specified in milliseconds.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
task CAsyncTask The task to repeat.
interval number The interval to repeat the task in milliseconds.
Source:
Returns:
The created timer.
Type
CTimer

(static) worker(params) → {CAsyncWorker}

Creates the CAsyncWorker dedicated FIFO worker for background work to the client.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
onDataReceived CAsyncWorkerListener The listener for received data from the worker.
workerUrl string The url to the dedicated worker.
Source:
Returns:
The worker created from this namespace.
Type
CAsyncWorker