JKG -- notebook-http mode and incremental responses

34 views
Skip to first unread message

John Muehlhausen

unread,
Sep 23, 2022, 4:00:41 PM9/23/22
to Project Jupyter
Can notebook-http return the cell result as it is printed?  For example, immediately return

[

then periodically return

{...},

and finally

{...}]

?

For a long-running cell this might be required to keep something from timing out, such as a proxy.  It would also be useful for generating a "stream."

-John

John Muehlhausen

unread,
Sep 26, 2022, 5:04:10 PM9/26/22
to Project Jupyter

This hot patch does what I want... immediate send instead of accumulation.  Not sure I can recommend it for general inclusion since it raises the spectre of how to handle an error that happens after some of the body has already been sent.


sed -i "$(fgrep -n "result_accumulator['stream'].append((msg['content']['text']))" /usr/local/lib/python3.8/dist-packages/kernel_gateway/notebook_http/handlers.py | cut -d: -f1)s/[^ ].*/self.write(msg['content']['text']); self.flush()/" /usr/local/lib/python3.8/dist-packages/kernel_gateway/notebook_http/handlers.py

Reply all
Reply to author
Forward
0 new messages