Skip to content

panic: "The Promise Sender was dropped" #25

Description

@emilk

poll-promise panics if the user drops the Sender before sending a value.

This is quite a footgun.

A dropped sender is a bug (because we cannot deliver a value), but I'm not sure it deserves a crash.

We could change the interface of Promise to return a Result, with an error for "DroppedSender".

We could also consider having the panic only in debug builds, and in release builds treat a dropped receiver the same as a receiver that hasn't sent anything yet, i.e. the promise will be stuck in "Pending" forever. Perhaps with a logged warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions