Skip to content

Make it possible to check whether the receiver of a SendPort is alive. #30784

Open
@lrhn

Description

@lrhn

It's currently not possible to see whether sending on a SendPort is useful or it just gets lost in the void.
It can get lost either if the receiving isolate is dead, or just if the receive-port has stopped listening.

We should consider adding a Future<bool> get isAlive; (or similar) on SendPort which allows the user to check whether the receiver is still listening.
We should not distinguish whether the isolate is dead or the port is just closed.

Currently, all isolate communication is local, so there is no problem doing that. If we ever generalize to network-based communication, we'll need some way to handle lost messages and dropped connections anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-llibrary-isolatetype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions