Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Task locals for Tulip/asyncio

Project description

Task locals support for tulip/asyncio
~~~~~~~~~~~~~~~~~~~~~

It provides Task local storage similar to python's threading.local
but for Tasks in asyncio.

Using task locals has some caveats:

* Unlike thread locals, where you are always sure that at least one thread is running(namely main thread), Task locals are available only in the context of a running Task. So if you try to access a task local from outside a Task you will get a RuntimeError.
* Be aware that using asyncio.async, asyncio.wait, asyncio.gather, asyncio.shield and friends launches a new task, so these coroutines will have its own local storage.

For more information on using locals see the docs for threading.local in python's standard library

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tasklocals, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size tasklocals-0.2.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page