Short answer if you come from Google: Plack is a toolkit containing middleware, helpers and web server adapters to run PSGI. Plack is NOT a web server but it's rather a "web server interface" which means if you want to run you PSGI application on any web servers, look at Plack to find handlers.
The namespace "Plack::Server::*" to implement PSGI web server was abandoned, and they're renamed to their own namespaces (like Starman, Twiggy, Corona, POE::Component::Server::PSGI or HTTP::Server::PSGI) and we now have Plack::Handler::* as thin adapters to connect Plack to those web servers.
--
There's always been a confusion on what Plack really is.
First, there were people who thinks "Plack is a framework." This is probably because we have Plack::Request as a separate utility module on CPAN to write "mini-frameworks". Our current plan to kill this confusion is to merge Plack::Request to core as a middleware library and release the current Plack::Request under a new name, kind of like Python's WebOb.py.
Then today I had the following conversations on IRC with Marcus and Theory. They say different things on Plack, and the problem is that they're mostly correct, but the view where they look at Plack from makes them say different things.
Most people on the application developer side thinks "speak PSGI" and "use Plack" mean the same thing. That is totally fine. Using tools like Plack middleware and Plack::Test doesn't add any dependency for particular Plack server environments.
What's confusing you and some of us internally, is that this "Server" means different things: 1) Standalone Web server that speaks PSGI 2) Web server adapters for CGI and FastCGI and 3) plackup and the daemon process. etc.
There's a couple of PSGI servers out there, and most of them are implemented as a Standalone HTTP server and has Plack::Server::* namespace, while other web server extensions are called like mod_psgi, evpsgi or Perlbal::Plugin::PSGI.
I've been thinking this is a bit confusing, but didn't have a tuit to rename it since that might cause compatibility issues for early adaptors. Today, however, we chatted on #plack and decided to make some changes. But no worries, the changes are 99% transparent unless you're one of the very few server developers (and all of them are involved in this discussion already).
Plack::Server stays is gone, now we have Plack::Handler and they are adapters
Plack::Server namespace will be gone and renamed to Plack::Handler, and plackup -s BlahBlah autoloads the server backend appropriately. That'll be the same and nobody should ever change any code around it. The only changes you need is when you have a hard-coded CGI scripts that has "Plack::Server::CGI->new->run" in it. That will continue to work for a certain amount of period but you're recommended to rewrite it with Plack::Handler, or even better, use Plack::Loader to autoload, without hardcoding the class names.
I already started this process on the branch, and it's now more straightforward. Server::Standalone is now renamed to Handler::Standalone, and it's now an adapter to dispatch the standalone PSGI server implementation whether single proc or preforking one. We had a huge bikeshedding discussion about its names, but we agreed HTTP::Server::PSGI is the most appropriate and intuitive name to upload to CPAN, assuming it's a "reference implementation".
We potentially have another "application" like HTTP server (think of Ruby web servers such as Thin, Mongrel, Rainbows! and such) with a different name but uses HTTP::Server::PSGI and its Prefork class as a base class, and we can continue to have Plack::Handler namespace for adapters/bridges to those new web servers.
Similarly, Plack::Server::POE would be renamed to POE::Component::Server::PSGI, so does Plack::Server::AnyEvent be AnyEvent::HTTPD::PSGI, etc. etc.
Well, these bridge classes are called "handlers" in Rack and wsgiref anyway. We always thought it's kind of confusing but we now figure out why they do this, because it's really confusing to name those adapters "Servers" :)
Anyway, I'm all for having top level namespaces to have some software that stands out, but i don't disagree to having descriptive names like POE::Component::Server::*, assuming that plays well with the standard CPANisms that is already out there.
I hope this is one of the last very few things to shave before making Plack 1.0 release... :)
+1, but you knew that.
Posted by: hdp | 2010.01.11 at 18:55
> nomo --max-workers 20 app.psgi
Can't locate HTTP/Server/PSGI.pm in @INC
Can you help me?
Posted by: zhang | 2010.01.15 at 00:04
Nomo needs Plack from its github master. But in general you're trying this too early :)
Posted by: miyagawa | 2010.01.15 at 00:19