danneu / kog

🌶 A simple Kotlin web framework inspired by Clojure's Ring.
43 stars 4 forks source link

Rebuild the websocket abstraction for use with new Router.kt #8

Closed danneu closed 7 years ago

danneu commented 7 years ago

I built the websocket abstraction for use with the old/original Router.kt. I need to rebuild/rethink it now that I have the new Router.kt (formerly SafeRouter.kt).

For one, the websocket acceptor should be refactored from its lambda-heavy impl to something with an ad-hoc usage more like:

websocket("/foo", fun(): = object : WebsocketHandler {
    override fun onConnect() = ...
    ...
})

Also, the websocket/jetty interop in Server.kt is nasty. But I really like the idea of nesting websocket handlers beneath existing middleware.

ThraaxSession commented 7 years ago

Oh oh. This will be a totally API break. I guess you will remove the current implementation?

danneu commented 7 years ago

@GinoHereIam This is a stale issue so I'll close it. 😄

I don't see myself changing the websocket system anytime soon since I don't use it in production.

danneu commented 7 years ago

Oh, I've changed the websocket system since I made this issue 8 months ago. I just never updated the issue.

When I made this issue, the WebSocketHandler was a lot different than it is now.

ThraaxSession commented 7 years ago

@danneu I am glad now :D I want to use your websocket in "production"

BTW great work! :) I am happy with it!