Hi everyone. I am exploring SSE functionality in K...
# ktor
h
Hi everyone. I am exploring SSE functionality in Ktor 3. Can somebody please help me understand the purpose of the
while (true)
loop in this example? I tried running that code and it seems to work fine with or without the
while (true)
loop in place.
c
My guess is that the loop facilitate’s the browser’s automatic reconnection when using EventSource
h
Thank you, Casey. I am little confused about the ability to reconnect an SSE connection in Ktor 3. Ktor documentation here describes the
reconnectionTime
property, suggesting that it is supported. However, a note immediately after that says "Note that reconnection is currently not supported." Can somebody who is knows please clarify the situation?
a
The automatic reconnection isn't supported yet. Please follow https://youtrack.jetbrains.com/issue/KTOR-6242 for updates. The documentation will be updated.
h
Thank you, @Aleksei Tirman [JB]. Can you please also help me understand the purpose of
while(true)
loop in the example code in Ktor documentation?
a
It's redundant because the
collect
method collects all events anyway.
h
Thank you!
z
@Aleksei Tirman [JB] do you know if Automatic reconnection is something that will be added soon? There are no updates on the ticket other than linking to it from other tickets.
a
The work should be started soon on that issue.
❤️ 4