/
Workers.ts
31 lines (26 loc) · 953 Bytes
/
Workers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Time } from '@sofie-automation/blueprints-integration'
import { WorkerId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import { protectString } from '../lib'
export interface WorkerStatus {
_id: WorkerId
/** A user-facing name */
name: string
/** The instance id is unique each time a worker starts up */
instanceId: string
/** Timestamp for when the worker was first created */
createdTime: Time
/** Timestamp for when the worker was last started */
startTime: Time
/** Timestamp of last status update */
lastUpdatedTime: Time
/** If the worker is connected (alive) or not */
connected: boolean
status: string
// studioId (or other context-descriptor)
}
export function getWorkerId(): WorkerId {
// This is a placeholder function for now.
// Later on, when we support multiple workers, this will determine unique worker names using things like
// the studio it works on, etc.
return protectString('default')
}