How to Provide a Scope to a Service with a Finalizer in Effect Typescript Library
Hi there! Does someone know how to provide a scope to a Service, so that if this service contains a finalizer, the finalizer is run only when the scope of the context using this layer is being closed?
Imagine a service that initializes a DatabaseConnection or sets up a change stream for user authentication information. I'd like to setup those tasks in the service and then return an APIs that allow me to use e.g. the database or react to changes of a user within another (long running) program.