Skip to content

Commit

Permalink
Easiest solution
Browse files Browse the repository at this point in the history
  • Loading branch information
danpf committed May 13, 2019
1 parent ee10084 commit 5938763
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,14 @@ def _update_scheduler_info(self):
except EnvironmentError:
logger.debug("Not able to query scheduler for identity")

@gen.coroutine
def _wait_until_n_workers(self, n):
while n and len(self.cluster.scheduler.workers) < n:
yield gen.sleep(0.01)

def wait_until_n_workers(self, n):
return self.sync(self._wait_until_n_workers, n)

def _heartbeat(self):
if self.scheduler_comm:
self.scheduler_comm.send({"op": "heartbeat-client"})
Expand Down

0 comments on commit 5938763

Please sign in to comment.