Skip to content

Commit

Permalink
Add _wait argument for local runner. This fixes broken pipe error.
Browse files Browse the repository at this point in the history
  • Loading branch information
severb committed Mar 15, 2015
1 parent 68379b4 commit bf201f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions flowy/backend/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def child_runner(self, workflow, w_id, args, kwargs):
def set_decision(self, decision):
self.decision = decision

def run(self):
def run(self, wait=False):
self.reschedule_decision()
self.stop.wait()
self.activity_executor.shutdown(wait=False)
self.workflow_executor.shutdown(wait=False)
self.activity_executor.shutdown(wait=wait)
self.workflow_executor.shutdown(wait=wait)
if hasattr(self, 'result'):
return self.result
if hasattr(self, 'exception'):
Expand Down Expand Up @@ -365,7 +365,8 @@ def __call__(self, state, *args, **kwargs):
return d

def run(self, *args, **kwargs):
wait = kwargs.pop('_wait', False)
a_executor = self.executor(max_workers=self.activity_workers)
w_executor = self.executor(max_workers=self.workflow_workers)
wr = WorkflowRunner(self, w_executor, a_executor, args, kwargs)
return wr.run()
return wr.run(wait=wait)

0 comments on commit bf201f8

Please sign in to comment.