Class 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
    Version:
    $Id: fd84d3dbf49f15221bf430a8703a19286db64256 $
    Author:
    Chris Rebert (github@chrisrebert.com)
    • Constructor Detail

      • 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