4 ms·
IMHO the cleaner way to achieve this is some sort of message/reactor pattern, passing data to some in-process event sourcing store, that way you don't have thin
by kortex 6y ago
IMHO the cleaner way to achieve this is some sort of message/reactor pattern, passing data to some in-process event sourcing store, that way you don't have things altering globals willy-nilly.
However, I recently needed to just yeet some large data objects across two contexts. The solution I used was the Borg pattern with a Mapping interface and with an RLock around getitem/setitem.
It feels surprisingly clean. It behave much like an external message queue, which is what it was replacing.
https://github.com/faif/python-patterns/blob/master/patterns/creational/borg.py https://github.com/faif/python-patterns/blob/master/patterns...