src/main/java/com/aperlambda/apercommon/connection/RequestSender.java
public S sendRequest(Q request, Consumer<S> success, Consumer<IOException> error)
    {
        S response = null;
        try
        {
            response = sendRequest(request);
            success.accept(response);
        }
        catch (IOException e)
        {
            error.accept(e);
        }
        return response;
    }
/**
     * Sends the request and returns the received response and execute different consumers.
     *
     * @param request The request which will be send.
     * @param success The consumer which will be execute if it succeed.
     * @param error   The consumer which will be execute if it failed.
     * @return The received response.
     */
Sends the request and returns the received response and execute different consumers.
@param request The request which will be send.
@param success The consumer which will be execute if it succeed.
@param error   The consumer which will be execute if it failed.
@return The received response.
Sends the request and returns the received response and execute different consumers . @param request The request which will be send . @param success The consumer which will be execute if it succeed . @param error The consumer which will be execute if it failed . @return The received response .
public S sendRequest(Q request, Consumer<S> success, Consumer<IOException> error)
    {
        S response = null;
        try
        {
            response = sendRequest(request);
            success.accept(response);
        }
        catch (IOException e)
        {
            error.accept(e);
        }
        return response;
    }
public S sendRequest ( Q request , Consumer < S > success , Consumer < IOException > error ) { S response = null ; try { response = sendRequest ( request ) ; success . accept ( response ) ; } catch ( IOException e ) { error . accept ( e ) ; } return response ; }
Sends the request and returns the received response and execute different consumers.
Sends the request and returns the received response and execute different consumers .