Jovan
Jovan
SIASapphire - Imagine a framework
Created by Jovan on 1/31/2025 in #sapphire-support
MikroORM with Sapphire (AsyncLocalStorage)
Is there a good way of creating AsyncLocalStorage contexts when working with sapphire? This is used for forking the EntityManager instance in MikroORM but I can find some other use-cases for it as well. My first idea is rather messy and I'm not sure if it even works: I would monkey patch all loaded pieces and wrap their run() methods with a function that would create the context. Is there a better way to do this?
7 replies