Package org.asynchttpclient.filter
Class ReleasePermitOnComplete
- java.lang.Object
-
- org.asynchttpclient.filter.ReleasePermitOnComplete
-
public final class ReleasePermitOnComplete extends Object
Wrapper forAsyncHandler
s to release a permit onAsyncHandler.onCompleted()
. This is done via a dynamic proxy to preserve all interfaces of the wrapped handler.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> AsyncHandler<T>
wrap(AsyncHandler<T> handler, Semaphore available)
Wrap handler to release the permit of the semaphore onAsyncHandler.onCompleted()
.
-
-
-
Method Detail
-
wrap
public static <T> AsyncHandler<T> wrap(AsyncHandler<T> handler, Semaphore available)
Wrap handler to release the permit of the semaphore onAsyncHandler.onCompleted()
.- Type Parameters:
T
- the handler result type- Parameters:
handler
- the handler to be wrappedavailable
- the Semaphore to be released when the wrapped handler is completed- Returns:
- the wrapped handler
-
-