There are currently 3 distinct use cases for connection validation.
Validating a single connection and waiting for a result.
Validating a single connection without blocking.
Validating multiple connections all at the same time where the operation is async but the results are waited on.
This patch adds two methods to ConnectionValidator called #applyAsync to meet these use cases.
I would have preferred a single method, but this strategy affords a lot of flexibility.
These API changes made the validation code in AbstractConnectionPool much cleaner, eliminating the need for a cached thread pool.
Another ancillary benefit is that the #apply method now enforces the timeout, it no longer needs to be implemented by the invoker.
There are currently 3 distinct use cases for connection validation. Validating a single connection and waiting for a result. Validating a single connection without blocking. Validating multiple connections all at the same time where the operation is async but the results are waited on.
This patch adds two methods to ConnectionValidator called #applyAsync to meet these use cases. I would have preferred a single method, but this strategy affords a lot of flexibility. These API changes made the validation code in AbstractConnectionPool much cleaner, eliminating the need for a cached thread pool. Another ancillary benefit is that the #apply method now enforces the timeout, it no longer needs to be implemented by the invoker.
See #188