Keep track if connection to streaming API is still working #429
-
Hi, I'm working on a social wall project for Mastodon with the bigbone library in the Java backend. To my understanding an unhealthy connection should trigger some events, that are passed to my callback So where should be no unhealthy connection without a trigger? kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi!
Yes. If we receive a WebSocket failure, we propagate it to you via the
As written in its kDoc, that’s a terminal event that would close the WebSocket connection. So if you receive it, you’d need to try to connect again if you want to keep the connection going.
From what we’ve seen so far: Correct 😊 As long as you do not receive any Hope that helps? |
Beta Was this translation helpful? Give feedback.
Hi!
Yes. If we receive a WebSocket failure, we propagate it to you via the
WebSocketCallback
’sonEvent
method you would implement.TechnicalEvent.Failure
is the one you’re looking for then:bigbone/bigbone/src/main/kotlin/social/bigbone/api/entity/streaming/WebSocketEvent.kt
Lines 42 to 47 in 1750db8