pjfanning commented on PR #1757: URL: https://github.com/apache/pekko/pull/1757#issuecomment-4780016327
@He-Pin the reason that I haven't pushed to merge this, is that I am not happy with having the new RandomNumberGenerator instance being an object that reads a static config. I'm thinking that I could add make add a randomNumberGenerator() method to the ActorSystem and that it returns a Java 17+ RandomGenerator instance. This randomNumberGenerator is not intended to cryptographically strong and where you need that, you should still use SecureRandom directly. The new randomNumberGenerator would be a wrapper for ThreadLocalRandom by default and via the system config, it can be made to return a wrapper for Java 21+ https://openjdk.org/jeps/356 compatible RandomGenerator instead. With an ActorSystem instance that has a hot path requiring random numbers, I would expect the Java compiler to optimise the code because the config would only be read once at ActorSystem creation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
