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

Function scheduleClock

packages/effect/src/cluster/ClusterWorkflowEngine.ts:1027–1046  ·  view source on GitHub ↗
(workflow, options)

Source from the content-addressed store, hash-verified

1025 ),
1026
1027 scheduleClock(workflow, options) {
1028 // Compute the deadline once, so a retried save keeps the original wake-up.
1029 return Effect.flatMap(DateTime.now, (now) =>
1030 retryPersistence(sendDiscard({
1031 rpc: ClockRpc,
1032 address: entityAddressFor({
1033 workflow,
1034 entityType: ClockEntity.type,
1035 executionId: options.executionId
1036 }),
1037 payload: {
1038 name: options.clock.name,
1039 workflowName: workflow._tag,
1040 wakeUp: DateTime.mapEpochMillis(
1041 DateTime.addDuration(now, options.clock.duration),
1042 Math.ceil
1043 )
1044 }
1045 })))
1046 }
1047 })
1048
1049 return engine

Callers

nothing calls this directly

Calls 2

retryPersistenceFunction · 0.85
entityAddressForFunction · 0.85

Tested by

no test coverage detected