WorkerMessage
Class: WorkerMessage
Defined in: packages/workout/src/core.ts:442
Represents a message emitted by WorkerOutput and consumed by loggers
Indexable
[
key:string]:any
Additional arbitrary properties merged from infos
Constructors
Constructor
new WorkerMessage(
type,workout?,infos?):WorkerMessage
Defined in: packages/workout/src/core.ts:472
Create a new WorkerMessage
Parameters
type
Event type discriminator
workout?
WorkerOutput instance whose current state is captured
infos?
any = {}
Additional properties to merge into the message
Returns
WorkerMessage
Properties
context?
optionalcontext?:object
Defined in: packages/workout/src/core.ts:464
Source location of the log call (populated when addLogProducerLine is enabled)
column?
optionalcolumn?:number
file?
optionalfile?:string
function?
optionalfunction?:string
line?
optionalline?:number
currentProgress?
optionalcurrentProgress?:string
Defined in: packages/workout/src/core.ts:450
UID of the currently active progress (if any)
data?
optionaldata?:string
Defined in: packages/workout/src/core.ts:454
Raw program output attached to "output" messages
groups
groups:
string[]
Defined in: packages/workout/src/core.ts:444
Active log group stack at the time of emission
input?
optionalinput?:WorkerInput
Defined in: packages/workout/src/core.ts:462
Input request/response attached to input-related messages
log?
optionallog?:WorkerLog
Defined in: packages/workout/src/core.ts:452
Log entry attached to "log" messages
pid
pid:
number
Defined in: packages/workout/src/core.ts:458
PID of the process that emitted the message
progresses
progresses:
object={}
Defined in: packages/workout/src/core.ts:448
Snapshot of all active progress indicators at emission time
Index Signature
[key: string]: WorkerProgress
timestamp
timestamp:
number
Defined in: packages/workout/src/core.ts:456
Unix timestamp (ms) when the message was created
type
type:
WorkerMessageType
Defined in: packages/workout/src/core.ts:446
Discriminator that identifies the kind of event
Methods
fromJSON()
staticfromJSON(json):WorkerMessage
Defined in: packages/workout/src/core.ts:489
Deserialize a WorkerMessage from JSON
Parameters
json
string
JSON string representation of a WorkerMessage
Returns
WorkerMessage
A fully reconstructed WorkerMessage instance with proper types