Class: CAsyncWorker

codemelted.CAsyncWorker(onDataReceived, url)

Definition class for a dedicated FIFO thread separated worker / process. Data is queued to this worker via CAsyncWorker.postMessage method and terminated via the CAsyncWorker.terminate method.

Constructor

new CAsyncWorker(onDataReceived, url)

Constructor for the worker.
Parameters:
Name Type Description
onDataReceived CAsyncWorkerListener The callback for received data.
url string The URL of the dedicated worker.
Source:

Methods

postMessage(data) → {void}

Posts dynamic data to the background worker.
Parameters:
Name Type Description
data any The data to transmit.
Source:
Returns:
Type
void

terminate() → {void}

Terminates the dedicated background worker.
Source:
Returns:
Type
void