Resubscribe listeners when subscription link breaks.
// FREEBIE
This commit is contained in:
parent
2e429c5b35
commit
41d30fc8dc
|
@ -64,6 +64,12 @@ public class PubSubManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private synchronized void resubscribeAll() {
|
||||||
|
for (String serializedAddress : listeners.keySet()) {
|
||||||
|
baseListener.subscribe(serializedAddress.getBytes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private synchronized void waitForSubscription() {
|
private synchronized void waitForSubscription() {
|
||||||
try {
|
try {
|
||||||
while (!subscribed) {
|
while (!subscribed) {
|
||||||
|
@ -149,6 +155,13 @@ public class PubSubManager {
|
||||||
subscribed = true;
|
subscribed = true;
|
||||||
PubSubManager.this.notifyAll();
|
PubSubManager.this.notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
threaded.execute(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
resubscribeAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue