-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send frame should suspend until delivery of the message #125
Comments
Hi @Shusek, thanks for reporting this! The expected behaviour is described in the documentation of
I'm assuming you have Since you're using Ktor, the suspension will be determined by Ktor's implementation. It seems that there is some buffer in the outgoing frames channel of Ktor's websocket (from Ktor's doc):
I guess this is why you observe this behaviour. Most likely if you send a bunch of frames, the Could you please explain the use case a bit more in detail? If what you want is to detect when the server has received the message, it would be more correct to enable STOMP receipts instead. Otherwise, why do you need to suspend until the frame is sent but not necessarily until the server has received the message? |
My usecase was to check if the connection was broken, but after consideration i can just observe flow and catch exception and retry last message. |
Mmmh that's actually interesting, as a user I would also expect to get an exception at the moment I call
Could you please clarify which flow you're talking about here? |
As you probably noticed from my previous issue the system I work with is in obsolete phase and that's the main reason why i can't use At this moment i implemented something close to |
@Shusek I'm so sorry I realized I never replied to your last comment. The last snippet you provided shouldn't be sufficient IMO, because you will be missing the actual The goal of #102 is not only to reconnect but also to automatically re-send the |
Describe the bug
During the tests, it turned out that the sending frame block is not suspending as it would seem logical. I expected until the message not to be sent
convertAndSend
function suspend my block, instead of that this function returns almost immediately, is a bit strange because the message has not been sent yet. Is this planned behavior?Reproduction and additional details
Context
Kotlin version:
Krossbow version:
Kotlin target(s): (e.g. browser, NodeJS, JVM, Android, a multiplatform combination?) Android
Artifacts used:
krossbow-stomp-core
krossbow-stomp-jackson
krossbow-stomp-kxserialization
krossbow-websocket-core
krossbow-websocket-sockjs
krossbow-websocket-spring
krossbow-websocket-okhttp
krossbow-websocket-ktor
The text was updated successfully, but these errors were encountered: