Reference·JavaScript · @sascom/jsclientJavaScript

Task

Class in @sascom/jsclient.

API catalogue · @sascom/jsclient · Class

TypeScript#
class Task

Members#

Member Kind Description
constructor Method
id Property
request Property
taskName Property
addStream Method
detailsUpdate Method
error Method
exec Method
execAsPromise Method
live Method A never-finishing subscription: issued again (new id, same input and handlers) after every reconnect. key: for a subscription the server allows once per sess…
log Method
metricDefinitionUpdate Method
metricUpdate Method
newBinaryData Method
newData Method
progress Method
reissued Method Called just before a live task is issued again: clear what the previous snapshot filled.
send Method
setNodeId Method
setTimeOut Method
setUi Method Names the part of the UI a person asked this from, sent as the request's ui (at most 40 of a-z 0-9 . -); only for a call a person started, never the appl…
statusChange Method
success Method
taskInfo Method
terminate Method

constructor#

TypeScript#
constructor()

id#

TypeScript#
public readonly id: string

request#

TypeScript#
public readonly request: unknown

taskName#

TypeScript#
public readonly taskName: string

addStream#

TypeScript#
public addStream(name: string, file: unknown): void

Parameters#

Name Type Description
name string
file unknown

detailsUpdate#

TypeScript#
public detailsUpdate(detailsUpdateCallback: (details: unknown) => void): Task

Parameters#

Name Type Description
detailsUpdateCallback (details: unknown) => void

error#

TypeScript#
public error(errorCallback: (error: unknown, response: unknown) => void): Task

Parameters#

Name Type Description
errorCallback (error: unknown, response: unknown) => void

exec#

TypeScript#
public exec(): void

execAsPromise#

TypeScript#
public execAsPromise(returnResponse?: boolean): Promise<unknown>

Parameters#

Name Type Description
returnResponse boolean true: resolve with the whole response instead of its result

live#

TypeScript#
public live(key?: string): Task

A never-finishing subscription: issued again (new id, same input and handlers) after every reconnect. key: for a subscription the server allows once per session; a later live task with the same key replaces it.

Parameters#

Name Type Description
key string

log#

TypeScript#
public log(levels: (string)[], logCallback: (level: string, log: unknown) => void): Task

Parameters#

Name Type Description
levels (string)[]
logCallback (level: string, log: unknown) => void

metricDefinitionUpdate#

TypeScript#
public metricDefinitionUpdate(keys: (string)[], metricDefinitinUpdateCallback: (metricDefinition: unknown) => void): Task

Parameters#

Name Type Description
keys (string)[]
metricDefinitinUpdateCallback (metricDefinition: unknown) => void

metricUpdate#

TypeScript#
public metricUpdate(keys: (string)[], metricUpdateCallback: (metricUpdate: unknown) => void): Task

Parameters#

Name Type Description
keys (string)[]
metricUpdateCallback (metricUpdate: unknown) => void

newBinaryData#

TypeScript#
public newBinaryData(topicIds: (string)[], dataListener: (data: unknown) => void): Task

Parameters#

Name Type Description
topicIds (string)[]
dataListener (data: unknown) => void

newData#

TypeScript#
public newData(topicIds: (string)[], dataListener: (data: unknown) => void): Task

Parameters#

Name Type Description
topicIds (string)[]
dataListener (data: unknown) => void

progress#

TypeScript#
public progress(progressCallback: (label: string, progress: number) => void): Task

Parameters#

Name Type Description
progressCallback (label: string, progress: number) => void

reissued#

TypeScript#
public reissued(callback: (task: Task) => void): Task

Called just before a live task is issued again: clear what the previous snapshot filled.

Parameters#

Name Type Description
callback (task: Task) => void

send#

TypeScript#
public send(topicId: string, message: unknown): void

Parameters#

Name Type Description
topicId string
message unknown

setNodeId#

TypeScript#
public setNodeId(nodeId: string): Task

Parameters#

Name Type Description
nodeId string

setTimeOut#

TypeScript#
public setTimeOut(value: number, unit: string): Task

Parameters#

Name Type Description
value number
unit string

setUi#

TypeScript#
public setUi(ui: string | null): Task

Names the part of the UI a person asked this from, sent as the request's ui (at most 40 of a-z 0-9 . -); only for a call a person started, never the application's own.

Parameters#

Name Type Description
ui string | null

statusChange#

TypeScript#
public statusChange(statusses: (string)[], statusChangeCallback: (status: string) => void): Task

Parameters#

Name Type Description
statusses (string)[]
statusChangeCallback (status: string) => void

success#

TypeScript#
public success(successCallback: (result: unknown, fullresponse: unknown) => void): Task

Parameters#

Name Type Description
successCallback (result: unknown, fullresponse: unknown) => void

taskInfo#

TypeScript#
public taskInfo(taskInfoCallback: (taskInfo: unknown) => void): Task

Parameters#

Name Type Description
taskInfoCallback (taskInfo: unknown) => void

terminate#

TypeScript#
public terminate(): void