Skip to content

I need a way to run a coroutine when unloading a plugin #29

@rwols

Description

@rwols

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions