3 ms·
I really don't understand what's the problem with async local storage. This is a very awful context, for example it is very easy to spawn a new routine and "lea
by ex3ndr 7y ago
I really don't understand what's the problem with async local storage. This is a very awful context, for example it is very easy to spawn a new routine and "leak" transaction for example to a worker.
We tried different ways to do so and easiest method is just have some specific "Context" object and pass it as first/last argument to every function. This is really very easy once you will start using contexts. You already passing something like transactions and other specific data, nothing new, just opaque .
We have built really tiny library for this: https://github.com/openland/context https://github.com/openland/context and it is working great. We had zero issues with developers not passing context and very short learning time.