[Mongrel] when to use mongrail plugins ?

Zed Shaw zedshaw at zedshaw.com
Wed Mar 15 01:19:33 EST 2006


Roberto,

Yes, your example would be a good example of a plugin.  I¹m currently doing
the 0.3.11 release which is the ³official² release that works and has the
initial gem plugins stuff going.

0.3.12 will feature the ability to actually configure the handlers and
filters based on plugins from a config file.  In this way, you¹ll write the
plugin like you describe, then people will attach it to the right URI and
they get your feature.

I¹ll also be stealing the query string and file upload handling code from
Camping so that Mongrel can handle those as well.

In general the purpose of plugins is for people to extend mongrel¹s features
without having to modify mongrel code or do much configuration.  If you
compare it with rails plugins there¹s usually a fair amount of install and
configuration done even after you¹d setup a plugin.  Add to this the way you
have to discover plugins and you¹ll find that gem plugins are much easier to
use.  As examples of what I want to use gem plugins for:

* Add filters for file upload handling to arbitrary handlers.
* Create output filters for gzip
* Implement a memcache on-the-fly response filter that will give you dynamic
caching inside mongrel (rather than rails).
* Automated hyper estraier indexing of content similar to mod_estraier
* Statistics gathering and reporting.
* Management tools or configuration tools.  This I¹ve already implemented in
the 0.3.11 release¹s configtool.

But I¹m sure other people will come up with their own neat things.

Zed


On 3/14/06 7:25 PM, "Roberto Saccon" <rsaccon at gmail.com> wrote:

> Hi all
> 
> I just went throught the docomentation of mogrel and I am wondering wht the
> plugins are good for. I understood how the work and I am comparing the
> situation to Lighttpd where mods are available for specific tasks. But in
> Lighttpd (or apache) those mods are running at native speed. But at mongrel,
> if the plugins are writte in ruby, couldn't that code just be a rails plugin ?
> 
> One thing I would like to have  is a sophisticated upload handler, which stops
> upload if a preconfigured max. filesize gets reached. Ist that a problem which
> could be solved with a mongrel plugin ?





More information about the Mongrel-users mailing list