(
workflow: Workflow.Any,
executionId: string,
options?: {
readonly scope?: Scope.Closeable | undefined
/**
* Awaited deferred names shared with the run this instance belongs to.
* An activity instance registers its durable waits there so the run
* can be woken once it suspends, without those waits preempting it.
*/
readonly awaitedDeferreds?: Map<string, number> | undefined
}
)
| 309 | } |
| 310 | >()("effect/workflow/WorkflowEngine/WorkflowInstance") { |
| 311 | static initial( |
| 312 | workflow: Workflow.Any, |
| 313 | executionId: string, |
| 314 | options?: { |
| 315 | readonly scope?: Scope.Closeable | undefined |
| 316 | /** |
| 317 | * Awaited deferred names shared with the run this instance belongs to. |
| 318 | * An activity instance registers its durable waits there so the run |
| 319 | * can be woken once it suspends, without those waits preempting it. |
| 320 | */ |
| 321 | readonly awaitedDeferreds?: Map<string, number> | undefined |
| 322 | } |
| 323 | ): WorkflowInstance["Service"] { |
| 324 | return WorkflowInstance.of({ |
| 325 | executionId, |
| 326 | workflow, |
| 327 | scope: options?.scope ?? Scope.makeUnsafe(), |
| 328 | suspended: false, |
| 329 | interrupted: false, |
| 330 | abandoned: false, |
| 331 | cause: undefined, |
| 332 | failed: false, |
| 333 | awaitedDeferreds: options?.awaitedDeferreds ?? new Map(), |
| 334 | completedDeferreds: new Set(), |
| 335 | activityState: { |
| 336 | count: 0, |
| 337 | latch: Latch.makeUnsafe() |
| 338 | } |
| 339 | }) |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /** |
no test coverage detected