private void process(final FetchTokenFromSphereMessage m) { if (!isWaitingForToken) { isWaitingForToken = true; final CompletableFuture<Tokens> future = internalTokensSupplier.get(); onSuccess(future, tokens -> tell(new SuccessfulTokenFetchMessage(tokens))); onFailure(future, e -> tell(new FailedTokenFetchMessage(e, m.attempt + 1))); } }