MCPcopy Create free account
hub / github.com/Effect-TS/effect / initial

Method initial

packages/effect/src/workflow/WorkflowEngine.ts:311–340  ·  view source on GitHub ↗
(
    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
    }
  )

Source from the content-addressed store, hash-verified

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/**

Callers 15

index.test.tsxFile · 0.80
startAttemptFunction · 0.80
Send.tst.tsFile · 0.80
Atom.test.tsFile · 0.80
Hydration.test.tsFile · 0.80
Query.test.tsFile · 0.80
Scene.test.tsFile · 0.80
Validation.test.tsFile · 0.80
Workflow.test.tsFile · 0.80

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected