Skip to content

Commit

Permalink
Add a close method to AsyncMultiMap
Browse files Browse the repository at this point in the history
This allows cluster managers to free resources they use to maintain the state.

Needed for vert-x3/issues#316

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
  • Loading branch information
tsegismont committed Jan 10, 2018
1 parent 4d2d6b0 commit 278fc2e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/io/vertx/core/spi/cluster/AsyncMultiMap.java
Expand Up @@ -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.
*
* <p>
* <strong>Warning</strong>: always call {@link #close()} when you are done with an {@link AsyncMultiMap} instance.
* Cluster managers may hold resources to maintain its state.
* </p>
*
* @author <a href="http://tfox.org">Tim Fox</a>
*
*/
Expand Down Expand Up @@ -71,4 +76,11 @@ public interface AsyncMultiMap<K, V> {
* @param completionHandler This will be called when the remove is complete
*/
void removeAllMatching(Predicate<V> p, Handler<AsyncResult<Void>> 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() {
}
}

0 comments on commit 278fc2e

Please sign in to comment.