[Mongrel] request_ends callback

Thorsten von Eicken tve at rightscale.com
Sun Apr 22 12:41:07 EDT 2007


I'm putting together a file upload server using the merb upload progress 
stuff (nice!) and I wish there was a request_ends callback. Why? I need 
to do some processing of the file after the upload (like pushing it to 
Amazon S3 in the back) and I'd like to continue providing user feedback 
through the progress HTTP requests The nicest way to do that would be to 
leverage the UploadProgress class since it has an instance for the 
specific upload_id. However, before my merb process handler gets called, 
the UploadProgress is deleted. I'd be glad to insert a request_ends 
callback into mongrel itself, but I'm not sure where to hook it. Would 
HttpServer#process_client right after the "handlers.each do" be a good spot?
Thanks for an awesome web server!
- Thorsten


More information about the Mongrel-users mailing list