hawkw/mycelium

maitake: consider some kind of user-provided runtime hooks

hawkw opened this issue · 3 comments

hawkw commented

since maitake is intended to be used as a lower-level "async runtime construction kit" rather than a complete out-of-the-box solution, we might want to figure out some way for users to provide additions hooks that run on events that occur "inside" the runtime.

currently, the Schedule trait is user-implementable, so it's possible for user code to implement it for a type that wraps a maitake provided implementation of Schedule and runs additional functionality in Schedule methods. it might be worth adding an example of this in the documentation.

but, the Schedule trait doesn't have methods for a number of other events that user code might want to hook into. in particular, it could be worth adding methods for:

  • binding a new task to a scheduler
  • deallocating a task
  • ???
hawkw commented

see also #238

hawkw commented

@jamesmunns any additional things that happen inside the scheduler that you might want to hook into?

I don't have any feedback! I don't feel like I've needed anything, but a lot of the stuff like this that I've needed ends up living in the global kernel/userspace scheduler instance instead.