Closed
Description
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
Labels
No labels