mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
MessageConsumer unregister() should return a Future<Void>
This commit is contained in:
@@ -13,6 +13,7 @@ package io.vertx.core.eventbus;
|
||||
|
||||
import io.vertx.codegen.annotations.VertxGen;
|
||||
import io.vertx.core.AsyncResult;
|
||||
import io.vertx.core.Future;
|
||||
import io.vertx.core.Handler;
|
||||
import io.vertx.core.streams.ReadStream;
|
||||
|
||||
@@ -92,7 +93,7 @@ public interface MessageConsumer<T> extends ReadStream<Message<T>> {
|
||||
/**
|
||||
* Unregisters the handler which created this registration
|
||||
*/
|
||||
void unregister();
|
||||
Future<Void> unregister();
|
||||
|
||||
/**
|
||||
* Unregisters the handler which created this registration
|
||||
|
||||
@@ -121,8 +121,10 @@ public class HandlerRegistration<T> implements MessageConsumer<T>, Handler<Messa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregister() {
|
||||
doUnregister(null);
|
||||
public Future<Void> unregister() {
|
||||
Promise<Void> promise = Promise.promise();
|
||||
doUnregister(promise);
|
||||
return promise.future();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user