async-executor
async-executor copied to clipboard
Allow creating tasks with metadata
async-task allows arbitrary metadata to be attached to tasks. It would be nice if this were available in async-executor as well.
Currently taking a crack at this. I was wondering about the reasoning behind requiring the output of Executor::schedule() to be 'static. The comments of Executor::spawn_inner() mention that
// `self.schedule()` is `Send`, `Sync` and `'static`, as checked below. // Therefore we do not need to worry about what is done with the // `Waker`.
Would requiring it to have the lifetime of the Executor be enough to get the guarantees that we need?