Effect CommunityEC
Effect Community2y ago
3 replies
Patrick Roza

Ensuring Last-Minute Execution with Effect.ensuring Before Process Closure

is this a reasonable way of running something at the very last moment before process closure?
runMain(
  Layer.launch(program).pipe(
    Effect.ensuring(Effect.promise(() => Sentry.flush(10_000)))
  )
)

i'm a bit weary of using scoped layer, after having had issues with finalizers running before daemon fibers were finished processing
Was this page helpful?