When unloading a plugin, some coroutine may need to run to shutdown connections gracefully (e.g., language clients closing connections gracefully with language servers).
Currently there's no way to run a coroutine when a plugin unloads.
I can perhaps use run_coroutine / call_coroutine in plugin_unloaded, but I'm seeing this creates problems with modules having been unloaded.
I think one way to solve this is to allow running a coroutine in the main thread. In the sense of stopping the loop temporarily, starting it from the main thread, and waiting for that one coroutine to be finished, then continue running in the sublime_aio thread.
When unloading a plugin, some coroutine may need to run to shutdown connections gracefully (e.g., language clients closing connections gracefully with language servers).
Currently there's no way to run a coroutine when a plugin unloads.
I can perhaps use
run_coroutine/call_coroutineinplugin_unloaded, but I'm seeing this creates problems with modules having been unloaded.I think one way to solve this is to allow running a coroutine in the main thread. In the sense of stopping the loop temporarily, starting it from the main thread, and waiting for that one coroutine to be finished, then continue running in the sublime_aio thread.