From 278fc2e1821d54f250a927be9211b92bd6effebe Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Wed, 10 Jan 2018 15:41:39 +0100 Subject: [PATCH] Add a close method to AsyncMultiMap This allows cluster managers to free resources they use to maintain the state. Needed for vert-x3/issues#316 Signed-off-by: Thomas Segismont --- .../io/vertx/core/spi/cluster/AsyncMultiMap.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/io/vertx/core/spi/cluster/AsyncMultiMap.java b/src/main/java/io/vertx/core/spi/cluster/AsyncMultiMap.java index 5d6bb1f1a9c..bc4a1947149 100644 --- a/src/main/java/io/vertx/core/spi/cluster/AsyncMultiMap.java +++ b/src/main/java/io/vertx/core/spi/cluster/AsyncMultiMap.java @@ -26,6 +26,11 @@ * The cluster implementation should ensure that any entries placed in the map from any node are available on any * node of the cluster. * + *

+ * Warning: always call {@link #close()} when you are done with an {@link AsyncMultiMap} instance. + * Cluster managers may hold resources to maintain its state. + *

+ * * @author Tim Fox * */ @@ -71,4 +76,11 @@ public interface AsyncMultiMap { * @param completionHandler This will be called when the remove is complete */ void removeAllMatching(Predicate p, Handler> completionHandler); + + /** + * Call this method when you are done with the {@link AsyncMultiMap} instance. + * Cluster managers may hold resources to maintain its state. + */ + default void close() { + } }