Open carllerche opened 2 years ago
I am curious if it would make sense to pass the PRNG to the macro select!
directly rather than seeding it through the runtime. One use case that I have is to be able to use third-party schedulers, like the ones provided by Shuttle framework
How would passing a custom rng help with using third-party schedulers?
Third-party schedulers do not use Tokio runtime, so it does not seem possible to seed select!
rng in this case? That is the case for concurrency tests where Tokio scheduler is replaced to run concurrency tests, while code that is being tested uses tokio::select!
macro
Is your feature request related to a problem? Please describe.
select!
uses randomness to prevent selecting branches in the same order. However, there are times that we do not want non-determism, e.g. using loom.Describe the solution you'd like
There should be an API for seeding any random number generation as part of the runtime Builder API.
A quick sketch: