public void addSnapshotWatcher(SnapshotWatcher<? super T> watcher) {
        requireNonNull(watcher, "watcher");
        checkState(!closed, "Watcher %s can't be registered since %s is already closed.",
                   watcher, getClass().getSimpleName());
        if (!eventLoop.inEventLoop()) {
            eventLoop.execute(() -> addSnapshotWatcher(watcher));
            return;
        }
        if (closed) {
            return;
        }
        snapshotWatchers.add(watcher);
        if (snapshot != null) {
            try {
                watcher.snapshotUpdated(snapshot);
            } catch (Throwable t) {
                logger.warn("Unexpected exception while invoking {}.snapshotUpdated",
                            watcher.getClass().getSimpleName(), t);
            }
        }
    }
Adds a watcher which waits for a snapshot update.
xds/src/main/java/com/linecorp/armeria/xds/AbstractRoot.java