-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port and cleanup of old reactive tests for Nima bulkheads #4823
Conversation
…sync class for convenience, now implemented using virtual threads.
Signed-off-by: Santiago Pericasgeertsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comment before merging
* Runs synchronous suppliers asynchronously using virtual threads. Includes | ||
* convenient static method to avoid creating instances of this class. | ||
*/ | ||
public interface Async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have excluded async intentionally, as it does not really make sens - you can execute anything as a blocking operation, and if you need to run multiple things in parallel, you are better off using an executor service directly.
If you feel strongly we should keep this in for symmetry with SE and MP, then OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be useful to use virtual threads for running concurrent actions, to further test the infrastructure. Using supplyAsync
created real threads AFAICT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case we should also support supplying a custom executor service (in case the user wants to choose whether to use platform or virtual threads)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. I will add that in a follow-up PR.
Port and cleanup of old reactive tests for Nima bulkheads. Restored Async class for convenience, now implemented using virtual threads.