Skip to content

No way to represent a set of tasks #670

Closed
@canndrew

Description

@canndrew

I want to implement a future which can be cloned so that multiple tasks can be blocked waiting for the same external event. This doesn't seem to be possible to implement. Task doesn't implement Hash or Eq so I can't keep the set of pending tasks in a HashSet or even a Vec because there's no way to de-duplicate the tasks. If someone keeps poll()ing my future, or keeps cloning new ones, the Vec would grow indefinitely.

Could we give Task an implementation of Hash or Ord + Eq or something? Alternatively, could we add a TaskSet type for this use-case?

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