Update ReplicatorMessageAdapter#subscribe (#31050)
The method was calling `unsubscribe` twice.
This commit is contained in:
parent
221da34234
commit
04e22c3687
2 changed files with 2 additions and 6 deletions
|
|
@ -68,9 +68,7 @@ class ReplicatorMessageAdapter[A, B <: ReplicatedData](
|
|||
def subscribe(key: Key[B], responseAdapter: akka.japi.function.Function[Replicator.SubscribeResponse[B], A]): Unit = {
|
||||
// unsubscribe in case it's called more than once per key
|
||||
unsubscribe(key)
|
||||
changedMessageAdapters.get(key).foreach { subscriber =>
|
||||
replicator ! Replicator.Unsubscribe(key, subscriber)
|
||||
}
|
||||
|
||||
val replyTo: ActorRef[Replicator.SubscribeResponse[B]] =
|
||||
context.messageAdapter(classOf[Replicator.SubscribeResponse[B]], responseAdapter)
|
||||
changedMessageAdapters = changedMessageAdapters.updated(key, replyTo)
|
||||
|
|
|
|||
|
|
@ -71,9 +71,7 @@ class ReplicatorMessageAdapter[A, B <: ReplicatedData](
|
|||
def subscribe(key: Key[B], responseAdapter: Replicator.SubscribeResponse[B] => A): Unit = {
|
||||
// unsubscribe in case it's called more than once per key
|
||||
unsubscribe(key)
|
||||
changedMessageAdapters.get(key).foreach { subscriber =>
|
||||
replicator ! Replicator.Unsubscribe(key, subscriber)
|
||||
}
|
||||
|
||||
val replyTo: ActorRef[Replicator.SubscribeResponse[B]] =
|
||||
context.messageAdapter[Replicator.SubscribeResponse[B]](responseAdapter)
|
||||
changedMessageAdapters = changedMessageAdapters.updated(key, replyTo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue