T - The type of requestsU - The type of responsespublic interface Requester<T,U>
May be useful as an entry point for Future-based APIs such as
Notification.toDocumentEvents() and DocumentEvent.lookupDocument().
The only contract of a requester is that it perform the provided requests and call the right
FutureTransforms with the responses for the associated requests, and capture their
results in Futures, at some point in time in the future. This point of time may
be immediately in the same thread, lazily in the same thread, after a remote call in another
thread, etc. Details are up to implementation.
TODO(ahenning,khowell): Investigate moving away from Future-based APIs to something which addresses batching more explicitly. Batching is a core concern of many of the APIs since they intentionally work with Collections in their interface, and is an almost universally applicable way to increase efficiency. Additionally, implementations which do not require or want batching can effectively work with a batch size of "1." For those that do benefit from batching, an API designed around this domain should be more straightforward to implement.
| Modifier and Type | Method and Description |
|---|---|
TransformableFuture<? extends Responses<T,U>> |
request(Collection<? extends T> requests) |
TransformableFuture<? extends Responses<T,U>> |
request(T... requests) |
TransformableFuture<? extends Responses<T,U>> request(T... requests)
TransformableFuture<? extends Responses<T,U>> request(Collection<? extends T> requests)
Copyright © 2016. All rights reserved.