Using Effect.runPromise in an Async Callback with a Third-Party Library

I'm using a third party lib that takes an async callback - if I want to run effects within that callback is it safe to use Effect.runPromise? or will that spawn a different runtime instance?

What's the best approach for this kind of thing
        Effect.gen(function* () {
          // sql - third party, async callback for transactions
          sql.begin(async () => {
            await Effect.runPromise(...effectful code) // is this ok?
          })
        });
Was this page helpful?