Skip to content

Commit

Permalink
Atomically set subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Кирилл committed Sep 25, 2024
1 parent 8b5e3bd commit 1c34e7c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class GenericWsHead(
)
this.subscription.set(super.follow(heads))

if (headResubSubscription.get() == null) {
headResubSubscription.set(registerHeadResubscribeFlux())
}
headResubSubscription.compareAndSet(null, registerHeadResubscribeFlux())
}

override fun onNoHeadUpdates() {
Expand Down Expand Up @@ -182,6 +180,7 @@ class GenericWsHead(
}

private fun registerHeadResubscribeFlux(): Disposable {
println("here")
val connectionStates = wsSubscriptions.connectionInfoFlux()
.map {
if (it.connectionId == connectionId.get() && it.connectionState == WsConnection.ConnectionState.DISCONNECTED) {
Expand Down

0 comments on commit 1c34e7c

Please sign in to comment.