Closed miracle2k closed 5 years ago
@vmalloc Do Is it worth working on this? I do believe logbook should support this.
@miracle2k I think it is worth it, but unfortunately I have been quite busy recently so had no time to go over it...
I'm also interested in this feature, and I think it will be proved very useful in modern asyncio applications. @vmalloc, can you have a look?
BTW, right off the bat I see that the CI runs Python 2.7-3.6, and this feature needs 3.7 to be effective.
Also, since this PR started a long time ago, I can pick the devlopment from here if @miracle2k is too busy 😃
@matan129 Running Logbook on CI using 3.7 is not a trivial task (I tried to do it naively and failed) - the reason is that 3.7 requires a xenial environment, and that breaks the tons of setup the build has for stuff like ZeroMQ.
If you feel like it and have the time to open a PR to add 3.7, it would be greatly appreciated.
Nitpicking a bit here, but I guess this PR can be closed now that #290 has been merged?
@miracle2k do you have any objections to closing this issue? Is there anything missing?
Python 3.7 has something called contextvars: https://docs.python.org/3/library/contextvars.html They are like thread locals, but are bound to the current asyncio task. Other frameworks, such as trio (https://github.com/python-trio/trio) can (and do) use them as well. I suppose even gevent could use them.
As for as I understand, because they are more fine grained, they are effectively a superset of thread locals as well.
I made some choices here:
I am looking for some feedback, and general guidance as to what is required to get this merged.