use of io.vertx.core.eventbus.MessageConsumer in project vertx-openshift-it by cescoffier.
the class DistributedRequestReply method setup.
void setup(Handler<AsyncResult<Void>> handler) {
EventBus eventBus = vertx.eventBus();
MessageConsumer<String> consumer = createMessageConsumer(eventBus, address);
consumer.handler(msg -> {
msg.reply(clusterManager.getNodeID());
}).completionHandler(ar -> {
if (ar.succeeded()) {
handler.handle(Future.succeededFuture());
} else {
handler.handle(Future.failedFuture(ar.cause()));
}
});
}
use of io.vertx.core.eventbus.MessageConsumer in project vert.x by eclipse.
the class NetSocketImpl method unregisterEventBusHandler.
void unregisterEventBusHandler() {
if (registration != null) {
MessageConsumer consumer = registration;
registration = null;
consumer.unregister();
}
}
use of io.vertx.core.eventbus.MessageConsumer in project vert.x by eclipse.
the class NetTest method setHandlers.
void setHandlers(NetSocket sock) {
Handler<Message<Buffer>> resumeHandler = m -> sock.resume();
MessageConsumer reg = vertx.eventBus().<Buffer>consumer("client_resume").handler(resumeHandler);
sock.closeHandler(v -> reg.unregister());
}
Aggregations