jupyter_ui_poll.ui_events
- jupyter_ui_poll.ui_events()[source]
Gives you a function you can call to process UI events while running a long task inside a Jupyter cell.
with ui_events() as ui_poll: while some_condition: ui_poll(10) # Process upto 10 UI events if any happened do_some_more_compute()
Async mode is also supported:
async with ui_events() as ui_poll: while some_condition: await ui_poll(10) # Process upto 10 UI events if any happened do_some_more_compute()
Call
kernel.do_one_iteration()
taking care of IO redirectsIntercept
execute_request
IPython kernel events and delay their executionSchedule replay of any blocked
execute_request
events when cell execution is finished.