Open ppkwiatkowski opened 4 years ago
Btw. with async prompt-toolkit
version >= 3.0.3
it was fairly easy to implement for my use-case by overwriting mainloop
from ZMQTerminalInteractiveShell
in my inherited shell class like that:
async def handle_background_iopub(self):
while self.keep_running:
self.handle_iopub()
await asyncio.sleep(1)
def mainloop(self):
asyncio.ensure_future(self.handle_background_iopub())
super().mainloop()
but maybe it could be done better
Is it possible to show output from background ioloop process in real time and not only when prompting for it? It is a problem when using applications that are logging something.
minimal repro:
import tornado; tornado.ioloop.PeriodicCallback(lambda: print("test output"), 2000).start()
in jupyter-console.