Returns the current (active on the moment of the execution of this method) attempt result
future, allowing to track progress of the retrying future execution.
Adding direct executor (same thread) callbacks to the future returned by this method is
strongly not recommended, since the future is resolved under retrying future's internal lock
and may affect the whole retrying process. Adding separate thread callbacks is ok.
This method is for internal/advanced use only.
The returned future completes right after the corresponding attempt which it tracks, so
calling
ApiFuture#get() is potentially a blocking operation. This method returns
exactly same future object until it completes (meaning that the corresponding attempt has
completed). If there is another attempt made after completion of the current attempt, the
subsequent call to this method will return a new future which will track the new attempt.
In case if the whole retrying future is completed, this method returns the same result as
the retrying future itself.
The returned future is non-cancellable, so calling
ApiFuture#cancel(boolean) will
have no effect and will always return
false.
The number of attempt results may be (and usually is) lower than the number of actual
attempts, since only a completed attempt has a result and not all attempts complete (some of
the service attempts, needed for proper execution of the actual attempts).
For each execution the following invariants hold:
- The future returned by this method completes soon after the attempt it tracks.
- If it was the last attempt, the futures complete in the following order: 1) the attempt
future; 2) the whole retrying future; 3) the attempt result future returned by this
method.
- After completion of the whole retrying future this method always returns exactly same
future object.