| | | 1 | | namespace Elsa.Workflows.Runtime; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Composite signal describing whether the runtime is accepting new work and, if not, why not. |
| | | 5 | | /// Immutable snapshot — the active state is always read through <c>IQuiescenceSignal.CurrentState</c>. |
| | | 6 | | /// </summary> |
| | 120 | 7 | | public sealed record QuiescenceState( |
| | 429 | 8 | | QuiescenceReason Reason, |
| | 27 | 9 | | DateTimeOffset? PausedAt, |
| | 17 | 10 | | DateTimeOffset? DrainStartedAt, |
| | 30 | 11 | | string? PauseReasonText, |
| | 22 | 12 | | string? PauseRequestedBy, |
| | 124 | 13 | | string GenerationId) |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Convenience derived flag: <c>true</c> iff <see cref="Reason"/> is <see cref="QuiescenceReason.None"/>. |
| | | 17 | | /// </summary> |
| | 274 | 18 | | public bool IsAcceptingNewWork => Reason == QuiescenceReason.None; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Creates the initial state for a fresh runtime generation. |
| | | 22 | | /// </summary> |
| | | 23 | | public static QuiescenceState Initial(string generationId) => |
| | 120 | 24 | | new(QuiescenceReason.None, null, null, null, null, generationId); |
| | | 25 | | } |