Skip to content

Expose Receiver::try_recv API #579

Closed
@faern

Description

@faern

The current channels are not analogous to the libstd ones. A notable missing feature is Receiver::try_recv for taking an item from the channel in a non blocking fashion.

I have a service where background workers conjure fairly expensive resources (start virtual machines, all of which are identical) and they then pass handles to these via a channel. On the other end is a user facing API where access to one such resource can be requested. I want to use try_recv to get an available resource from the channel. Because if there are no resources available I want the request to fail immediately. The API should yield immediate results, and no long queues should be built up.

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