Reference Source
public class | source

WorkerCommand

Extends:

devapt-core-common/dist/js/base/loggable~LoggableNameTypeSettingsLoggableCommand → WorkerCommand

Web worker command class.

Example:


	API:
		->do():Promise - do display.
		->undo():Promise - undo display and display history previous content.
		->start()
		->stop()

Constructor Summary

Public Constructor
public

constructor(arg_runtime: object, arg_settings: object, arg_log_context: string): nothing

Creates a web worker command instance.

Member Summary

Public Members
public

Class type flag.

Private Members
private
private
private

_worker: *

private

Method Summary

Public Methods
public

Check if command settings is valid.

public

stop()

Stop worker.

Private Methods
private

Do command.

private

Undo command.

Inherited Summary

From class NameTypeSettingsLoggable
public
private
private
private

_ui: *

public

Get instance name.

public

Get router.

public

Get runtime.

public

Get instance settings.

public

get_state_store(): Store

Get runtime state store.

public

Get instance type.

public

get_ui(): UI

Get UI.

public

Check if instance settings is valid.

From class Command
public
public

do(): Promise

Do command.

public

Undo command.

private

Do command.

private

Undo command.

Public Constructors

public constructor(arg_runtime: object, arg_settings: object, arg_log_context: string): nothing source

Creates a web worker command instance.

Command configuration is a simple object with:

    - url: local script url

Override:

Command#constructor

Params:

NameTypeAttributeDescription
arg_runtime object

client runtime.

arg_settings object

command settings.

arg_log_context string

context of traces of this instance (optional).

Return:

nothing

Public Members

public is_worker_command: boolean source

Class type flag.

Private Members

private _script_operands: * source

private _script_url: * source

private _worker: * source

private _worker_promise: * source

Public Methods

public is_valid(): boolean source

Check if command settings is valid.

Override:

NameTypeSettingsLoggable#is_valid

Return:

boolean

public stop() source

Stop worker.

Private Methods

private _do(): Promise source

Do command.

Override:

Command#_do

Return:

Promise

private _undo(): Promise source

Undo command.

Override:

Command#_undo

Return:

Promise