Open Noah-Kennedy opened 9 months ago
I think the first step here is to establish whether or not this is actually feasible - it may well not be.
An idea for a smaller change is: Is it possible to add a method to create a thread specifically that is only responsible for polling the driver and not for executing tasks?
Sometimes, it can be useful to be able to scale the amount of workers up or down.
For example, at Cloudflare we generally do graceful restarts by running both the old and new versions of a service at the same time and handing off the listener socket to the new version of the service, allowing the old one to keep running and serving traffic while the new one takes over. In cases like this, scaling down the number of workers on the old version of the service to limit it's resource usage can be a useful thing to do.
For this reason, I'm proposing allowing users to dynamically scale the number of worker threads they use at runtime up or down.