flush outgoing heartbeats

Prevents mismatch between heartbeat timer and actual heartbeat send/recv events.

Applied in notebook and parallel.
This commit is contained in:
MinRK 2012-01-23 13:40:01 -08:00
parent 0051df30f3
commit 370078020f

View File

@ -481,6 +481,8 @@ class IOPubHandler(AuthenticatedZMQStreamHandler):
if self._kernel_alive:
self._kernel_alive = False
self.hb_stream.send(b'ping')
# flush stream to force immediate socket send
self.hb_stream.flush()
else:
try:
callback()