NormalizedLifecycle treats the zero value as an idle, unassigned worker so existing worker structs can adopt this model without extra initialization.
()
| 85 | // NormalizedLifecycle treats the zero value as an idle, unassigned worker so |
| 86 | // existing worker structs can adopt this model without extra initialization. |
| 87 | func (s SharedWorkerState) NormalizedLifecycle() WorkerLifecycleState { |
| 88 | if s.Lifecycle == "" { |
| 89 | return WorkerLifecycleIdle |
| 90 | } |
| 91 | return s.Lifecycle |
| 92 | } |
| 93 | |
| 94 | // Validate checks that the lifecycle and assignment metadata are internally |
| 95 | // consistent. |
no outgoing calls