def thread_local_middleware(app):
    def application(environ, start_response):
        with thread_local():
            return app(environ, start_response)
    return application
To put your entire application in a :func:`~cosmic.globals.thread_local`
dataset/ETHPy150Open cosmic-api/cosmic.py/cosmic/globals.py/thread_local_middleware