Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upIdea: tokio-idle #669
Comments
tobz
closed this
Dec 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vorner commentedSep 27, 2018
Hello
On the gitter channel, I mentioned I'd find something that would be able to run bits of work at „idle“ time (eg. no tasks currently ready to make progress) useful. I think this can live outside of the base tokio package, but I want to let others know and coordinate/consult.
This is something else than priorities ‒ usually, with priorities, one wants to guarantee that the low prio tasks will get run too, even if getting smaller share of time. With this, the „idle“ work may never be run if the loop is not idle.
I have some vague idea what to do in the current-thread scenario, but I don't even know what should be done in the threaded case, not to mention how.
I'm putting some experiment/POC together here: https://github.com/vorner/tokio-idle.
I'm wondering if it makes sense to put another CurrentThread as part of the idle „layer“. If so, I'd need to make some changes to the API ‒ would it be OK to add something like LocalHandle to it (like Handle, but one that can't travel to other threads and can spawn
!Sendtasks)?