Effect CommunityEC
Effect Community5mo ago
5 replies
Skosh

`Workflow.execute` Hangs Without `discard: false` Option

is it expected behavior, that a Workflow.execute hangs (never resolves) unless we pass in discard: false? this caught me off guard:

const SendMessage = Singleton.make(
  "SendMessage",
  Effect.gen(function*() {
    yield* Effect.logInfo("Sending email")
    const result = yield* EmailWorkflow.execute({
      id: "test-123",
      to: "hi@timsmart.co"
    }, { discard: false })
    yield* Effect.logInfo("Result", result)
    yield* Effect.logInfo("This only runs with discard: false, otherwise this doesn't get printed")
  })
)
Was this page helpful?