-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add runAsync and supplyAsync methods to Async (#387)
These methods are aliases for the corresponding doAsync methods. We found cases (in the dropwizard-client-poller library) where the compiler was unable to determine whether a method reference was a Runnable or Supplier and we had to use a lambda instead. Adding these provides a way in ambiguous situations to disambiguate. And frankly they are probably better names anyway, and they are named the same as similar methods in CompletableFuture (which might be a good or a bad thing depending on context). Changes: * Add runAsync(Runnable) and runAsync(Runnable, Executor) * Add supplyAsync(Runnable) and supplyAsync(Runnable, Executor) * Restructure AsyncTest to use @nested style grouped by method; oddly I had to increase the timeout in one test, probably due to the additional overhead of all the nested classes. I increased it from 150 to 250 millis just to have an additional margin of safety. This was only necessary when running tests with coverage. Fixes #386
- Loading branch information
1 parent
682b363
commit e769e05
Showing
2 changed files
with
351 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.