hawkw/mycelium

maitake: add a "weak task handle" type

hawkw opened this issue · 1 comments

hawkw commented

PR #261 adds a JoinHandle type to maitake::task. A task can only have a single JoinHandle, since there is only one slot for a join waker. However, we could add a "weak task handle" type that allows accessing information about the task without the permission to await its completion and read its output. Unlike JoinHandles, this type could be freely cloned. Tokio has an equivalent of this with the AbortHandle type (currently unstable).

  • Once #264 is implemented, the weak handle type could also be used to abort a task.
  • Once #265 is implemented, the weak handle could also snapshot a task's status.
hawkw commented

this may just be "add additional methods to TaskRef"...