Skip to content

Commit

Permalink
rename compute_handlers to client_handlers
Browse files Browse the repository at this point in the history
Also put in client= keywords as appropriate
  • Loading branch information
mrocklin committed Jan 10, 2017
1 parent 9ac9998 commit a1ec093
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion distributed/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def unsubscribe(self, channel=None, client=None):
del self.clients[channel]
del self.stopped[channel]

def append(self, channel=None, key=None):
def append(self, channel=None, key=None, client=None):
if self.stopped[channel]:
return

Expand Down
18 changes: 9 additions & 9 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ def __init__(self, center=None, loop=None,
'release': self.handle_missing_data,
'add-keys': self.add_keys}

self.compute_handlers = {'update-graph': self.update_graph,
'client-desires-keys': self.client_desires_keys,
'update-data': self.update_data,
'report-key': self.report_on_key,
'client-releases-keys': self.client_releases_keys,
'restart': self.restart}
self.client_handlers = {'update-graph': self.update_graph,
'client-desires-keys': self.client_desires_keys,
'update-data': self.update_data,
'report-key': self.report_on_key,
'client-releases-keys': self.client_releases_keys,
'restart': self.restart}

self.handlers = {'register-client': self.add_client,
'scatter': self.scatter,
Expand Down Expand Up @@ -1073,9 +1073,9 @@ def handle_client(self, stream, client=None):
breakout = True
self.close()
break
elif op in self.compute_handlers:
elif op in self.client_handlers:
try:
handler = self.compute_handlers[op]
handler = self.client_handlers[op]
if 'client' not in msg:
msg['client'] = client
result = handler(**msg)
Expand Down Expand Up @@ -1299,7 +1299,7 @@ def gather(self, stream=None, keys=None):
raise gen.Return(result)

@gen.coroutine
def restart(self, environment=None):
def restart(self, environment=None, client=None):
""" Restart all workers. Reset local state. """
n = len(self.workers)
with log_errors():
Expand Down

0 comments on commit a1ec093

Please sign in to comment.