Search in sources :

Example 1 with Call

use of io.crossbar.autobahn.wamp.messages.Call in project autobahn-java by crossbario.

the class Session method reallyCall.

private <T> CompletableFuture<T> reallyCall(String procedure, List<Object> args, Map<String, Object> kwargs, CallOptions options, TypeReference<T> resultTypeReference, Class<T> resultTypeClass) {
    throwIfNotConnected();
    CompletableFuture<T> future = new CompletableFuture<>();
    long requestID = mIDGenerator.next();
    mCallRequests.put(requestID, new CallRequest(requestID, procedure, future, options, resultTypeReference, resultTypeClass));
    if (options == null) {
        send(new Call(requestID, procedure, args, kwargs, 0));
    } else {
        send(new Call(requestID, procedure, args, kwargs, options.timeout));
    }
    return future;
}
Also used : Call(io.crossbar.autobahn.wamp.messages.Call) CompletableFuture(java.util.concurrent.CompletableFuture) CallRequest(io.crossbar.autobahn.wamp.requests.CallRequest)

Aggregations

Call (io.crossbar.autobahn.wamp.messages.Call)1 CallRequest (io.crossbar.autobahn.wamp.requests.CallRequest)1 CompletableFuture (java.util.concurrent.CompletableFuture)1