src/main/java/org/cloudi/API.java
public Response recv_async(final Integer timeout,
                               final byte[] trans_id,
                               final boolean consume)
        throws InvalidInputException,
               MessageDecodingException,
               TerminateException
    {
        try
        {
            OtpOutputStream recv_async = new OtpOutputStream();
            recv_async.write(OtpExternal.versionTag);
            final OtpErlangObject[] tuple = {new OtpErlangAtom("recv_async"),
                                             new OtpErlangUInt(timeout),
                                             new OtpErlangBinary(trans_id),
                                             consume ?
                                             new OtpErlangAtom("true") :
                                             new OtpErlangAtom("false")};
            recv_async.write_any(new OtpErlangTuple(tuple));
            send(recv_async);
            return (Response) poll_request(null, false);
        }
        catch (OtpErlangRangeException e)
        {
            e.printStackTrace(API.err);
            return null;
        }
    }
public Response recv_async(final Integer timeout,
                               final byte[] trans_id,
                               final boolean consume)
        throws InvalidInputException,
               MessageDecodingException,
               TerminateException
    {
        try
        {
            OtpOutputStream recv_async = new OtpOutputStream();
            recv_async.write(OtpExternal.versionTag);
            final OtpErlangObject[] tuple = {new OtpErlangAtom("recv_async"),
                                             new OtpErlangUInt(timeout),
                                             new OtpErlangBinary(trans_id),
                                             consume ?
                                             new OtpErlangAtom("true") :
                                             new OtpErlangAtom("false")};
            recv_async.write_any(new OtpErlangTuple(tuple));
            send(recv_async);
            return (Response) poll_request(null, false);
        }
        catch (OtpErlangRangeException e)
        {
            e.printStackTrace(API.err);
            return null;
        }
    }
Asynchronously receive a response.

@param timeout  the receive timeout in milliseconds
@param trans_id the transaction ID to receive
@param consume  if <code>true</code>, will consume the service request
so it is not accessible with the same function call in
the future

@return         the response
@throws InvalidInputException invalid input to internal function call
@throws MessageDecodingException service messaging failure
@throws TerminateException service execution must terminate