So the two things im missing before im sold on kto...
# ktor
j
So the two things im missing before im sold on ktor is the ability to do work after the request has finished. And SSE
e
GlobalScope.launch { ... }
gives you that and SSE is trivial to implement.
j
Im assuming globalscope.launch is the context for coroutines, and im assuming that I could hold a coroutine channel inside an sse handler and feed it data?
e
To implement SSE you don’t let let request terminate. You keep responding indefinitely.
d
You can implement SSE like this, though websockets are more widely used and supported: https://github.com/ktorio/ktor-samples/blob/e9bbc563fa9bda5fda9f1fb1c41b20bb85beea70/other/sse/src/SseApplication.kt
1