Class ConcurrencyLimitingClient<I extends Request,​O extends Response>

    • Constructor Detail

      • ConcurrencyLimitingClient

        protected ConcurrencyLimitingClient​(Client<I,​O> delegate,
                                            int maxConcurrency)
        Creates a new instance that decorates the specified delegate to limit the concurrent number of active requests to maxConcurrency, with the default timeout of 10000L milliseconds.
        Parameters:
        delegate - the delegate Client
        maxConcurrency - the maximum number of concurrent active requests. 0 to disable the limit.
      • ConcurrencyLimitingClient

        protected ConcurrencyLimitingClient​(Client<I,​O> delegate,
                                            int maxConcurrency,
                                            long timeout,
                                            TimeUnit unit)
        Creates a new instance that decorates the specified delegate to limit the concurrent number of active requests to maxConcurrency.
        Parameters:
        delegate - the delegate Client
        maxConcurrency - the maximum number of concurrent active requests. 0 to disable the limit.
        timeout - the amount of time until this decorator fails the request if the request was not delegated to the delegate before then