-
Notifications
You must be signed in to change notification settings - Fork 15
Full Circle: Reading the host location is now asynchronous #5865
Conversation
Generate changelog in
|
|
||
/** | ||
* Supplier that will evaluate a delegate supplier asynchronously, providing a result when the underlying computation | ||
* is complete. This computation is only initiated after the first call to get, but will be memoized infinitely after |
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.
let's say that this returns Optional.empty until the result is available somewhere - that's part of the point of this
* This class is thread safe by synchronising on {@link #get()}. | ||
*/ | ||
@ThreadSafe | ||
final class AsyncSupplier<T> implements Supplier<Optional<T>> { |
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.
nit: we should follow atlasdb conventions (public class and public factory)?
👍 |
Released 0.520.0 |
Goals (and why):
==COMMIT_MSG==
The host location supplier is now run in a separate thread, and will return empty while evaluating. This is particularly important when the
Ec2HostLocationSupplier
repeatedly (and slowly) fails to connect, as this is on the creation path of theCassandraClientPoolImpl
and thus the transaction manager creation path.==COMMIT_MSG==
Implementation Description (bullets):
Introduce
AsyncSupplier
to encapsulate a supplier that should compute its result asynchronously...Testing (What was existing testing like? What have you done to improve it?):
Added a test.
Concerns (what feedback would you like?):
Where should we start reviewing?:
Diff
Priority (whenever / two weeks / yesterday):
Two years ago 🔥