Prechádzať zdrojové kódy

Async Backend: Actually pass result to waiter via bucket

Ask Solem 8 rokov pred
rodič
commit
a566a5141b
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  1. 7 1
      celery/backends/async.py

+ 7 - 1
celery/backends/async.py

@@ -125,6 +125,8 @@ class AsyncBackendMixin(object):
         if not results:
             raise StopIteration()
 
+        # we tell the result consumer to put consumed results
+        # into these buckets.
         bucket = deque()
         for node in results:
             if node._cache:
@@ -281,7 +283,11 @@ class BaseResultConsumer(object):
                 result._maybe_set_cache(meta)
                 buckets = self.buckets
                 try:
-                    buckets.pop(result)
+                    # remove bucket for this result, since it's fulfilled
+                    bucket = buckets.pop(result)
                 except KeyError:
                     pass
+                else:
+                    # send to waiter via bucket
+                    bucket.append(result)
         sleep(0)