Skip to content

Can promises be used for one-time events that may never occur? #73

@kainino0x

Description

@kainino0x

The One-time "events" section describes the use of Promises for one-time events. Is it acceptable to use for events that may never occur? For example, disconnection of a connection with an indefinite lifetime where reconnection isn't possible (e.g. a connection over a network or to a GPU or other hardware device).

I've gotten guidance from several sources in the past that this is an acceptable use of Promises, hence we used it in WebGPU, but it would be good to have guidance in this document. I'm not aware of usages of this pattern outside of WebGPU GPUDevice.lost, only of examples like ServiceWorkerContainer.ready. Are there any?

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