Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

decentfox/tasklocals

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Task locals for Tulip/asyncio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%