I'm using rayon for some expensive background tasks in my app.
Sometimes the user will perform some action in the app that generates new work that I want to run though rayon. I would like this work to take priority over the background work.
If I use the single global rayon thread pool for everything it creates problems. The background work must all be finished before the user work gets processed. To work around this I'm currently using two rayon thread pools, one for background tasks and one for user initiated tasks. This works pretty well, but I'm wondering if there's a better way to do it. A more general way of adding priority to tasks/scopes in rayon?