Skip to content

Make it easier to see if a Task is created/running/exited #3079

@jakkdl

Description

@jakkdl

It is currently possible to check the status of a task with https://docs.python.org/3/library/inspect.html#inspect.getcoroutinestate, but this is fairly obscure and not very readable.
We should either document this, or add properties to Task that are easy to interface with.
For implementing it, I think has_started() -> bool and has_exited -> bool would be a clean way of doing it.

I personally encountered this in #3035 (comment) which would only be for internal use, but I'm guessing it might be useful enough to surface in the public API.

See discussion in Gitter: https://matrix.to/#/!OqDVTrmPstKzivLwZW:gitter.im/$umF5oOw9d2Z20gb95GF_C48HyBi2l6eD3ZW4r_4ark0?via=gitter.im&via=matrix.org&via=zoltan.site

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions