tom-pytel commented on a change in pull request #89:
URL: https://github.com/apache/skywalking-python/pull/89#discussion_r529773910



##########
File path: skywalking/trace/context.py
##########
@@ -27,9 +25,52 @@
 from skywalking.utils.counter import Counter
 
 
+try:  # attempt to use async-local instead of thread-local context and spans
+    import contextvars
+
+    __local = contextvars.ContextVar('local')
+    __spans = contextvars.ContextVar('spans')  # this needs to be a per-task 
variable, can't be part of __local
+    _spans = __spans.get
+    _spans_set = __spans.set

Review comment:
       Never let a perfectly good piece of code get in the way of a proper 
linting I guess... Can you make this go away?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to