Search in sources :

Example 1 with Publish

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

the class Session method reallyPublish.

private CompletableFuture<Publication> reallyPublish(String topic, List<Object> args, Map<String, Object> kwargs, PublishOptions options) {
    throwIfNotConnected();
    CompletableFuture<Publication> future = new CompletableFuture<>();
    long requestID = mIDGenerator.next();
    mPublishRequests.put(requestID, new PublishRequest(requestID, future));
    if (options != null) {
        send(new Publish(requestID, topic, args, kwargs, options.acknowledge, options.excludeMe, options.retain));
    } else {
        send(new Publish(requestID, topic, args, kwargs, true, true, false));
    }
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) Publication(io.crossbar.autobahn.wamp.types.Publication) PublishRequest(io.crossbar.autobahn.wamp.requests.PublishRequest) Publish(io.crossbar.autobahn.wamp.messages.Publish)

Aggregations

Publish (io.crossbar.autobahn.wamp.messages.Publish)1 PublishRequest (io.crossbar.autobahn.wamp.requests.PublishRequest)1 Publication (io.crossbar.autobahn.wamp.types.Publication)1 CompletableFuture (java.util.concurrent.CompletableFuture)1