Class RetryCarefulWire

java.lang.Object
com.jcabi.github.wire.RetryCarefulWire
All Implemented Interfaces:
com.jcabi.http.Wire

@Immutable public final class RetryCarefulWire extends Object implements com.jcabi.http.Wire
Wire that waits if the number of remaining requests per hour is less than a given threshold, and in the event of IOException retries a few times before giving up and rethrowing the exception.

Just a wrapper for a RetryWire that wraps a CarefulWire that wraps the underlying wire.

You can use RetryCarefulWire with a GitHub object:

 
 GitHub github = new RtGitHub(
     new RtGitHub().entry().through(RetryCarefulWire.class, 50)
 );
 
 
Since:
0.23
  • Constructor Details

    • RetryCarefulWire

      public RetryCarefulWire(com.jcabi.http.Wire wire, int threshold)
      Public ctor.
      Parameters:
      wire - Original wire
      threshold - Threshold of number of remaining requests, below which requests are blocked until reset
  • Method Details