WorkerMessage
Class: WorkerMessage
Defined in: packages/workout/src/core.ts:427
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:457
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:449
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:435
UID of the currently active progress (if any)
data?
optionaldata?:string
Defined in: packages/workout/src/core.ts:439
Raw program output attached to "output" messages
groups
groups:
string[]
Defined in: packages/workout/src/core.ts:429
Active log group stack at the time of emission
input?
optionalinput?:WorkerInput
Defined in: packages/workout/src/core.ts:447
Input request/response attached to input-related messages
log?
optionallog?:WorkerLog
Defined in: packages/workout/src/core.ts:437
Log entry attached to "log" messages
pid
pid:
number
Defined in: packages/workout/src/core.ts:443
PID of the process that emitted the message
progresses
progresses:
object={}
Defined in: packages/workout/src/core.ts:433
Snapshot of all active progress indicators at emission time
Index Signature
[key: string]: WorkerProgress
timestamp
timestamp:
number
Defined in: packages/workout/src/core.ts:441
Unix timestamp (ms) when the message was created
type
type:
WorkerMessageType
Defined in: packages/workout/src/core.ts:431
Discriminator that identifies the kind of event
Methods
fromJSON()
staticfromJSON(json):WorkerMessage
Defined in: packages/workout/src/core.ts:474
Deserialize a WorkerMessage from JSON
Parameters
json
string
JSON string representation of a WorkerMessage
Returns
WorkerMessage
A fully reconstructed WorkerMessage instance with proper types