mpenet / jet

[not maintained, use at own risk] Jetty9 ring server adapter with WebSocket support via core.async and Jetty9 based HTTP & WebSocket clients (jvm based, no cljs)
http://mpenet.github.io/jet/
167 stars 19 forks source link

Allow set multiple websocket handlers (in different paths) #10

Closed niwinz closed 9 years ago

niwinz commented 9 years ago

Hi!

Currently, jet only supports one unique websocket handler, and would be awesome having a more flexible way to set multiple websocket handlers.

With approach implemented in this pr, allows set different websocket handlers in different paths. Obviously, this pr is "unfinished", because I want to ask you if you would include this change. In affirmative case, I will update pr with docs.

Additionally, supporting two ways to setup websocket handler may be confusing, and it has different approaches to manage this situation:

Thank you for the really fantastic package.

mpenet commented 9 years ago

Hi,

Thanks for the suggestion.

If you check the history of the commits it used to work like this, but I changed it in favor for a similar approach to the ring server adapters out there: having a main handler and leaving routing choice the end user. The way it works now you can define your routing with compojure, clout, or any routing lib. I am not sure I'd want to go back on this unless you have a compeling argument in favor of it.

niwinz commented 9 years ago

Hmm, I'm really like the two approaches, but in case of websockets I certainly prefer one handler one url due the nature of websocket handlers. But, obviously, I don't have compelling argument for convince to change.

As I said previously, this pr is only a purpose, the current approach is also a good point. Thank you again!