Skip to main content

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.

Source Distribution

tasklocals-0.2.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file tasklocals-0.2.tar.gz.

File metadata

  • Download URL: tasklocals-0.2.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tasklocals-0.2.tar.gz
Algorithm Hash digest
SHA256 c285a55a5578ab234c1fb6579aa9a9d6d1b01b0f0c070e4ad1763396870ab7f4
MD5 275f666ce0a28605e13959e87ddc4973
BLAKE2b-256 0638c228770a8c8cfab3b99ec3d9b8d84dc9f0736c2e18a6642000789767a968

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page