summaryrefslogtreecommitdiff
path: root/compose/parallel.py
diff options
context:
space:
mode:
authorAanand Prasad <aanand.prasad@gmail.com>2016-04-11 12:37:00 +0100
committerAanand Prasad <aanand.prasad@gmail.com>2016-04-11 12:37:00 +0100
commit0e3db185cf79e6638c2660be8e052af113ed7337 (patch)
tree83c8c80789310016a7c25049718d0eb86470f8b1 /compose/parallel.py
parent97467c7decf9b931f2dfed85884ed0617e01cd57 (diff)
Small refactor to feed_queue()
Put the event tuple into the results queue rather than yielding it from the function. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Diffstat (limited to 'compose/parallel.py')
-rw-r--r--compose/parallel.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/compose/parallel.py b/compose/parallel.py
index e360ca35..ace1f029 100644
--- a/compose/parallel.py
+++ b/compose/parallel.py
@@ -87,8 +87,7 @@ def parallel_execute_stream(objects, func, get_deps):
state = State(objects)
while not state.is_done():
- for event in feed_queue(objects, func, get_deps, results, state):
- yield event
+ feed_queue(objects, func, get_deps, results, state)
try:
event = results.get(timeout=0.1)
@@ -126,7 +125,7 @@ def feed_queue(objects, func, get_deps, results, state):
if any(dep in state.failed for dep in deps):
log.debug('{} has upstream errors - not processing'.format(obj))
- yield (obj, None, UpstreamError())
+ results.put((obj, None, UpstreamError()))
state.failed.add(obj)
elif all(
dep not in objects or dep in state.finished