Reference Source
public class | source

WebWorker

Web worker class.

Example:


	API:
		->do():Promise - do display.
		->start()
		->stop()

Constructor Summary

Public Constructor
public

constructor(arg_worker_name: string, arg_script_url: string): nothing

Creates a web worker instance.

Member Summary

Public Members
public

Class type flag.

Private Members
private

_name: *

private

_requests: {}

private
private

_worker: *

Method Summary

Public Methods
public

Get worker name.

public

process_error(arg_error: any): Promise

Process error.

public

process_response(arg_data: any): nothing

Process message response.

public

stop()

Stop worker.

public

submit_request(arg_data: any): Promise

Submit a request.

Public Constructors

public constructor(arg_worker_name: string, arg_script_url: string): nothing source

Creates a web worker instance.

Params:

NameTypeAttributeDescription
arg_worker_name string

worker name.

arg_script_url string

worker script url.

Return:

nothing

Public Members

public is_web_worker: boolean source

Class type flag.

Private Members

private _name: * source

private _requests: {} source

private _requests_count: number source

private _worker: * source

Public Methods

public get_name(): string source

Get worker name.

Return:

string

public process_error(arg_error: any): Promise source

Process error.

Params:

NameTypeAttributeDescription
arg_error any

processing error.

Return:

Promise

public process_response(arg_data: any): nothing source

Process message response.

Params:

NameTypeAttributeDescription
arg_data any

response data.

Return:

nothing

public stop() source

Stop worker.

public submit_request(arg_data: any): Promise source

Submit a request.

Params:

NameTypeAttributeDescription
arg_data any

request data.

Return:

Promise