Search in sources :

Example 1 with Subscribe

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

the class Session method reallySubscribe.

private <T> CompletableFuture<Subscription> reallySubscribe(String topic, Object handler, SubscribeOptions options, TypeReference<T> resultTypeRef, Class<T> resultTypeClass) {
    throwIfNotConnected();
    CompletableFuture<Subscription> future = new CompletableFuture<>();
    long requestID = mIDGenerator.next();
    mSubscribeRequests.put(requestID, new SubscribeRequest(requestID, topic, future, resultTypeRef, resultTypeClass, handler));
    send(new Subscribe(requestID, options, topic));
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) SubscribeRequest(io.crossbar.autobahn.wamp.requests.SubscribeRequest) Subscribe(io.crossbar.autobahn.wamp.messages.Subscribe) Subscription(io.crossbar.autobahn.wamp.types.Subscription)

Aggregations

Subscribe (io.crossbar.autobahn.wamp.messages.Subscribe)1 SubscribeRequest (io.crossbar.autobahn.wamp.requests.SubscribeRequest)1 Subscription (io.crossbar.autobahn.wamp.types.Subscription)1 CompletableFuture (java.util.concurrent.CompletableFuture)1