Fix race condition when updating output from other threads.
This applies when running in a notebook and may be a bug in ipywidgets. ipywidgets.Output.clear_output() does not wait until the output is cleared, so we were printing new items, which got cleared when clear_output() finally took effect.
Also, update calls to ipywidgets.Output to not use it as a context manager. The new way is more thread-safe.
This seems to work pretty well in Jupyter Notebook. However, out.clear_output() doesn't always clear the output even with sufficiently long wait. I don't know why; this may warrant further investigation.
Fix race condition when updating output from other threads.
This applies when running in a notebook and may be a bug in ipywidgets.
ipywidgets.Output.clear_output()
does not wait until the output is cleared, so we were printing new items, which got cleared whenclear_output()
finally took effect.Also, update calls to
ipywidgets.Output
to not use it as a context manager. The new way is more thread-safe.This seems to work pretty well in Jupyter Notebook. However,
out.clear_output()
doesn't always clear the output even with sufficiently long wait. I don't know why; this may warrant further investigation.This hopefully fixes https://github.com/eriknw/afar/issues/20