Skip to content

Commit

Permalink
Propagate future out for sending status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Nov 5, 2018
1 parent 0a18fb9 commit c3d63d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notebook/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,19 +396,19 @@ def _send_status_message(self, status):
{'execution_state': status}
)
ws_msg = serialize_message(msg, channel='iopub')
self.write_message(ws_msg, binary=isinstance(ws_msg, bytes))
return self.write_message(ws_msg, binary=isinstance(ws_msg, bytes))

def on_kernel_died(self, _data):
logging.warning("kernel %s died, noticed by auto restarter", self.kernel_id)
self._send_status_message('restarting')
return self._send_status_message('restarting')

def on_kernel_restarted(self, _data):
logging.warning("kernel %s restarted", self.kernel_id)
self._send_status_message('starting')
return self._send_status_message('starting')

def on_restart_failed(self, _data):
logging.error("kernel %s restarted failed!", self.kernel_id)
self._send_status_message('dead')
return self._send_status_message('dead')


#-----------------------------------------------------------------------------
Expand Down

0 comments on commit c3d63d0

Please sign in to comment.