EliAndrewC / sideboard

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Plugins should not need to import cherrypy directly #55

Closed EliAndrewC closed 8 years ago

EliAndrewC commented 10 years ago

Sideboard happens to use CherryPy as its server component. This is unlikely to change anytime soon, for the following reasons:

This is part of a larger discussion that we've had about whether it's okay for us to be intrinsically be tied to CherryPy. #33 is an example of a ticket which is about working around the limitations of CherryPy (technically it's working around the limitations of ws4py's CherryPy plugin, but still).

One middle ground between "just rely on CherryPy" and "rip out CherryPy and replace it with Tornado" (which we might eventually do, for performance reasons) is to have the basic CherryPy interactions wrapped with things in sideboard.lib. For example, instead of saying cherrypy.tree.mount() we could just say sideboard.lib.mount() and instead of raising cherrypy.HTTPRedirect we could have them raise sideboard.lib.HTTPRedirect, etc.

I'd like to take a closer look at Tornado to see how similar it is to CherryPy in terms of API. I know that you can host WSGI apps with it, and you can do the "your web server is just some of the threads in your Python process" thing with it, so it's a possible replacement that probably is much more performant.