Anyone understand in ? I'm trying to add support to so that when there isn't a...

@mistersql

Anyone understand in ? I'm trying to add support to so that when there isn't a web framework with a context to glom onto, that you can use the thread/thread.local/ContextVars and an alternative to the Application/Request that a web framework would provide.

So far, I can only get it to "work" if the ContextVars are globals.

gist.github.com/matthewdeanmar

Self-replies

Also, because there isn't a good event to hook into for the start of a python app, the start/stop events are decorators and/or context managers.

Also, atexit is braindamaged and only runs once per root process. I'm thinking of pulling in multiexit so that it works with multiple exists (say when using a process pool)