Synchronously call javascript function from python

It is possible to use some of the asynchronous widgets patterns. If you can avoid threads (the very last section)… do!

For example, use a custom events, a la Button, update when the thing changes, and hold until the queue gets emptied out, all wrapped up in an async function.

This would be in await-land, and would “block” execution continuing until the next cell so there wouldn’t be any cell race conditions. run_until_complete is kind of a bummer, though, as it can actually block the python process from getting anything else done… like processing kernel interrupt messages!