async-executor icon indicating copy to clipboard operation
async-executor copied to clipboard

Allow creating tasks with metadata

Open notgull opened this issue 1 year ago • 1 comments

async-task allows arbitrary metadata to be attached to tasks. It would be nice if this were available in async-executor as well.

notgull avatar Jan 05 '24 04:01 notgull

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?

avtrujillo avatar Mar 27 '25 01:03 avtrujillo