public final void sendAsyncRequest(RQ request, Callback<RP> callback) throws IOException { final Timer.Context context = sendTimer.time(); try { if (limiter.acquirePermits(1) != null) { log.debug ("Acquired permits successfully"); sendAsyncRequestImpl (request, callback); } else { throw new IOException ("Acquired permits return null"); } } catch (InterruptedException e) { throw new IOException("Throttling is interrupted"); } finally { context.stop(); } }
public final RP sendRequest(RQ request) throws IOException { final Timer.Context context = sendTimer.time(); try { if (limiter.acquirePermits(1) != null) { log.debug ("Acquired permits successfully"); return sendRequestImpl (request); } else { throw new IOException ("Acquired permits return null"); } } catch (InterruptedException e) { throw new IOException("Throttling is interrupted"); } finally { context.stop(); } }
public final RP sendRequest(RQ request) throws IOException { final Timer.Context context = sendTimer.time(); try { if (limiter.acquirePermits(1) != null) { log.debug ("Acquired permits successfully"); return sendRequestImpl (request); } else { throw new IOException ("Acquired permits return null"); } } catch (InterruptedException e) { throw new IOException("Throttling is interrupted"); } finally { context.stop(); } }
public final void sendAsyncRequest(RQ request, Callback<RP> callback) throws IOException { final Timer.Context context = sendTimer.time(); try { if (limiter.acquirePermits(1) != null) { log.debug ("Acquired permits successfully"); sendAsyncRequestImpl (request, callback); } else { throw new IOException ("Acquired permits return null"); } } catch (InterruptedException e) { throw new IOException("Throttling is interrupted"); } finally { context.stop(); } }