}
@GuardedBy("lock")
- abstract ClientActorBehavior<T> reconnectConnection(ClientActorBehavior<T> current);
+ abstract ClientActorBehavior<T> lockedReconnect(ClientActorBehavior<T> current);
private long readTime() {
return context.ticker().read();
}
}
+ final ClientActorBehavior<T> reconnect(final ClientActorBehavior<T> current) {
+ lock.lock();
+ try {
+ return lockedReconnect(current);
+ } finally {
+ lock.unlock();
+ }
+ }
+
/**
* Schedule a timer to fire on the actor thread after a delay.
*
delay = lockedCheckTimeout(now);
if (delay == null) {
// We have timed out. There is no point in scheduling a timer
- return reconnectConnection(current);
+ return lockedReconnect(current);
}
if (delay.isPresent()) {