Question

I know model, view and controller are independent of each other, but what about the controller which first handles the request?

Does the controller code need to be changed if I am changing the 'deployment server' (myapp_cgi.pl, myapp_fastcgi.pl or myapp_server.pl) or it can be managed by config files etc?

Was it helpful?

Solution

This won't matter to you at all. Catalyst is based on PSGI so you can move it between different deployment environments really easily.

OTHER TIPS

You don't need to change controller code if you choose another server with PSGI support for deployment.

From Catalyst::Manual::Deployment:

Catalyst applications are most often deployed as a FastCGI or mod_perl application (with FastCGI being the recommended option). However, as Catalyst is based on the PSGI specification, any web handler implementing that specification can be used to run Catalyst applications.

For more info about deployment options read man Catalyst::Manual::Deployment::*

Generally this won't matter unless you are pushing the edge and using some of the new, semi experimental features such as web socket support, non blocking writes, etc. In that case you might end up with logic that is specific to the event loop you choose (although with a little effort you should be able to isolate that to external code, and keep your controllers thing (see http://www.catalystframework.org/calendar/2013/14)

the next stable version of catalyst will have better support for streaming file handle content which will also be server choice dependent (for example twiggy with stream a filehandle via AIO::IO to give you non blocking streams, whereas Starman wouldn't do that (although Starman would support chunked responses). So the general case is it doesn't matter so much but if you are pushing the edge catalyst will do different things based on the underlying server capacity. So if you get to the metal you could lose server agnosticity. --jnap

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top