Added lockless FailureDetector.putIfAbsent(connection).
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
cd4a3c3a1a
commit
e70ab6d12c
3 changed files with 66 additions and 55 deletions
|
|
@ -103,8 +103,6 @@ class RemoveConnectionOnFirstFailureLocalFailureDetector extends FailureDetector
|
|||
state.get.iterable foreach (_.stop())
|
||||
}
|
||||
|
||||
def failOver(from: InetSocketAddress, to: InetSocketAddress) {} // do nothing here
|
||||
|
||||
@tailrec
|
||||
final def remove(ref: ActorRef) = {
|
||||
val oldState = state.get
|
||||
|
|
@ -120,6 +118,12 @@ class RemoveConnectionOnFirstFailureLocalFailureDetector extends FailureDetector
|
|||
if (!state.compareAndSet(oldState, newState)) remove(ref)
|
||||
}
|
||||
}
|
||||
|
||||
def failOver(from: InetSocketAddress, to: InetSocketAddress) {} // do nothing here
|
||||
|
||||
def putIfAbsent(address: InetSocketAddress, newConnectionFactory: () ⇒ ActorRef): ActorRef = {
|
||||
throw new UnsupportedOperationException("Not supported")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue