[Mongrel] Mongrel::HttpHandlerPlugin

Carl Woodward cjwoodward at gmail.com
Thu Oct 19 19:44:59 EDT 2006


Hi everyone,

I believe I have found the problem. In mongrel.rb (current stable
release) line 568:
---------------
notifier = handlers[0].request_notify ? handlers[0] : nil

request = HttpRequest.new(params, client, notifier)
---------------


>From what i can see, plugins that set request_notify will never be notified.

Should HttpRequest.initialize take an array of notifiers? That way you
can just change the notifier code to be:

request = HttpRequest.new(params, client, notifiers.select {
|notifier| notifier.request_notify })

I have changed the code very simply to get my plugin to work:

notifiers = handlers.select { |handler| handler.request_notify }
notifier = notifiers.empty? ? nil : notifiers[0]

request = HttpRequest.new(params, client, notifier)

This is a very simple change that will get me through for the moment
but I am interested to get feedback from the masters on whether I am
just being stupid.

Any help would be greatly appreciated?

Thanks,
Carl.

On 10/20/06, Carl Woodward <cjwoodward at gmail.com> wrote:
> Hi,
>
> I'm trying to write a file upload monitor for mongrel that uses
> juggernaut to alert the browser of a change. I'm writing a plugin that
> uses Mongrel::HttpHandlerPlugin but it looks like the only method that
> gets called is process and that is only when the upload has finished.
> I'm setting the following:
>
> @request_notify = true
>
> But I am still only getting process to come through.
>
> Any ideas?
>
> --
> Carl Woodward
>


-- 
Carl Woodward
0412218979
cjwoodward at gmail.com


More information about the Mongrel-users mailing list