##// END OF EJS Templates
flush replies when entering an eventloop...
MinRK -
Show More
@@ -251,5 +251,5 b' def enable_gui(gui, kernel=None):'
251 )
251 )
252 loop = loop_map[gui]
252 loop = loop_map[gui]
253 if loop and kernel.eventloop is not None and kernel.eventloop is not loop:
253 if loop and kernel.eventloop is not None and kernel.eventloop is not loop:
254 raise RuntimeError("Cannot activate multiple GUI eventloops")
254 raise RuntimeError("Cannot activate multiple GUI eventloops")
255 kernel.eventloop = loop
255 kernel.eventloop = loop
@@ -60,7 +60,7 b' class Kernel(Configurable):'
60 def _eventloop_changed(self, name, old, new):
60 def _eventloop_changed(self, name, old, new):
61 """schedule call to eventloop from IOLoop"""
61 """schedule call to eventloop from IOLoop"""
62 loop = ioloop.IOLoop.instance()
62 loop = ioloop.IOLoop.instance()
63 loop.add_timeout(time.time()+0.1, self.enter_eventloop)
63 loop.add_callback(self.enter_eventloop)
64
64
65 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
65 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
66 shell_class = Type(ZMQInteractiveShell)
66 shell_class = Type(ZMQInteractiveShell)
@@ -250,7 +250,11 b' class Kernel(Configurable):'
250
250
251 def enter_eventloop(self):
251 def enter_eventloop(self):
252 """enter eventloop"""
252 """enter eventloop"""
253 self.log.info("entering eventloop")
253 self.log.info("entering eventloop %s", self.eventloop)
254 for stream in self.shell_streams:
255 # flush any pending replies,
256 # which may be skipped by entering the eventloop
257 stream.flush(zmq.POLLOUT)
254 # restore default_int_handler
258 # restore default_int_handler
255 signal(SIGINT, default_int_handler)
259 signal(SIGINT, default_int_handler)
256 while self.eventloop is not None:
260 while self.eventloop is not None:
General Comments 0
You need to be logged in to leave comments. Login now