mirror of
https://github.com/reiseburo/rx-curator
synced 2024-09-15 06:41:58 +00:00
parent
904a5995cd
commit
3699f00042
@ -50,11 +50,6 @@ public class PathChildren {
|
||||
@Override
|
||||
public void call(final Subscriber<? super PathChildrenCacheEvent> subscriber) {
|
||||
cache = new PathChildrenCache(curatorFramework, znodePath, true);
|
||||
try {
|
||||
cache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT);
|
||||
} catch (Exception ex) {
|
||||
subscriber.onError(ex);
|
||||
}
|
||||
|
||||
cache.getListenable().addListener(new PathChildrenCacheListener() {
|
||||
@Override
|
||||
@ -62,6 +57,12 @@ public class PathChildren {
|
||||
subscriber.onNext(event);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
cache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT);
|
||||
} catch (Exception ex) {
|
||||
subscriber.onError(ex);
|
||||
}
|
||||
}
|
||||
}).doOnUnsubscribe(new Action0() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user