Returns a new {@link Retryer} instance with given {@link Callable}

@param target
@return
510686
public static <R> Retryer<R> of(Callable<R> target) {
        return new Retryer<R>(target);
    }
425319
public static Function<Client<RpcRequest, RpcResponse>, RetryingRpcClient>
    newDecorator(RetryStrategyWithContent<RpcResponse> retryStrategyWithContent) {
        return new RetryingRpcClientBuilder(retryStrategyWithContent).newDecorator();
    }
208320
public static <T, E extends Throwable> @NonNull Consumer<T> rethrowConsumer(final @NonNull ThrowingConsumer<T, E> consumer) {
    return consumer;
  }
1193079
public static <T> Callable<T> recover(Callable<T> callable, Function<Exception, T> exceptionHandler){
        return () -> {
            try{
                return callable.call();
            }catch (Exception exception){
                return exceptionHandler.apply(exception);
            }
        };
    }
886664
public RetryInterceptorBuilder<T> retryOperations(RetryOperations retryOperations) {
		Assert.isTrue(!this.templateAltered,
				"Cannot set retryOperations when the default has been modified");
		this.retryOperations = retryOperations;
		return this;
	}
883103
@SuppressWarnings("static-method")
	protected <T> Callable<T> createTask(Callable<T> callable) {
		if (callable instanceof JanusCallable<?>) {
			return callable;
		}
		return new JanusCallable<>(callable);
	}
500740
public static Exception rethrow(Throwable throwable) throws Error {
        try {
            throw throwable;
        } catch (Error error) {
            throw error;
        } catch (Exception exception) {
            return exception;
        } catch (Throwable throwable2) {
            return msg.undeclaredThrowable(throwable2);
        }
    }
26034
public static <T extends Throwable, A> Try<T, A> failure(T t) {
        return new Failure<>(t);
    }
176945
public MultiPrimaryProtocolBuilder withRetryDelay(long retryDelay, TimeUnit timeUnit) {
    return withRetryDelay(Duration.ofMillis(timeUnit.toMillis(retryDelay)));
  }
1031679
@SuppressWarnings("unchecked")
  public static <T> ComposableFuture<T> retry(final int retries, final Function<Integer, ComposableFuture<T>> producer) {
    final BiFunction<BiFunction, Integer, ComposableFuture<T>> retriable = (f, attempt) ->
      Try.apply(() -> producer.apply(attempt)).
        recover(ComposableFutures::fromError).
        map(action -> action.recoverWith(error -> {
            if (attempt >= retries) {
              return fromError(error);
            }

            // we can't safely use generics here since we'll get into infinite nested generics
            return (ComposableFuture<T>) f.apply(f, attempt + 1);
          })
        ).getValue();

    return retriable.apply(retriable, 0);
  }
1060919
public static <T> Level0SetOperator<Set<T>,T> onSet(final Set<T> target) {
        return new Level0SetOperator<Set<T>,T>(ExecutionTarget.forOp(target, Normalisation.SET));
    }
410330
public static Object invoke( Object target, String name ) throws Exception {
        return target.getClass().getMethod(name).invoke(target);
    }
1152060
private RetryingRegistration<F, G, S> createNewRegistration() {
		RetryingRegistration<F, G, S> newRegistration = checkNotNull(generateRegistration());

		CompletableFuture<Tuple2<G, S>> future = newRegistration.getFuture();

		future.whenCompleteAsync(
			(Tuple2<G, S> result, Throwable failure) -> {
				if (failure != null) {
					if (failure instanceof CancellationException) {
						// we ignore cancellation exceptions because they originate from cancelling
						// the RetryingRegistration
						log.debug("Retrying registration towards {} was cancelled.", targetAddress);
					} else {
						// this future should only ever fail if there is a bug, not if the registration is declined
						onRegistrationFailure(failure);
					}
				} else {
					targetGateway = result.f0;
					onRegistrationSuccess(result.f1);
				}
			}, executor);

		return newRegistration;
	}
221705
protected Promise retry(Throwable cause, String name, Tree params, CallOptions.Options opts, PacketStream stream,
			Context parent, String targetID, int remaining) {

		// Write error to log file
		if (writeErrorsToLog) {
			logger.error("Unexpected error occurred while invoking \"" + name + "\" action!", cause);
		}

		// Check error type and error counter
		if (remaining < 1 || !retryLogic.test(cause)) {
			return Promise.reject(cause);
		}

		// Call again...
		int newRemaining = remaining - 1;
		if (writeErrorsToLog) {
			logger.warn("Retrying request (" + newRemaining + " attempts left)...");
		}
		return call(name, params, opts, stream, parent, targetID, newRemaining);
	}
1039001
public <R extends Request<T>> R setRetryPolicy(RetryPolicy retryPolicy) {
        checkIfActive();
        this.retryPolicy = retryPolicy;
        return (R) this;
    }
332961
public <T> DynamicJdbcMapper<T> newMapper(final Class<T> target) {
		return newMapper((Type) target);
	}
1248243
@SuppressWarnings("unchecked")
	@Override
	public T retry(final int count, final int waitTime) {
		context().setMaxRetryCount(count).setRetryWaitTime(waitTime);
		return (T) this;
	}