Issue #55 new

WebSocketApplication is not technically a WSGI application

Sylvain Prat
created an issue

There's something that annoy me in the high-level API : the WebSocketApplication is not technically a WSGI application and thus, it can't be used as a WSGI application in a WSGI router for example (for example, werkzeug's DispatcherMiddleware) or as a response in a route handler.

This class looks like a kind of Response object (in werkzeug/webob terminology) to me but, since we are dealing with websocket, it does not represent a "single" response anymore.

I've rolled my own "WebSocketAgent" base class (that could have been called "WebSocketResponse" if the name didn't clash with something else) that has a similar high-level API. However, we can easily derive a WSGI application from it. Maybe that's something you can inspire from to improve the high-level API? That way, the Resource class would just become a "pure" WSGI regex router and the users would be able to choose another router if they want.

What's your opinion about this?

Comments (1)

  1. Log in to comment