From: Pete Hodgson Date: 2008-09-13T01:17:31+09:00 Subject: Re: processing loop Hi Omri, Another option (which I've had some success with) is using BackgrounDRb to manage a separate worker process which consumes items from a work queue. This worker process can be multithreaded. Your web app processes (mongrels or otherwise) would add work jobs to the queue using BackgrounDRb's IPC mechanisms. The work queue could be a database table, or maintained in memory by the worker process. Cheers, Pete Omri Cohen wrote: > Hey guys, > > I am trying to write an application with some various infinite loops > that basically poll data in a queue. Essentially, it is an asynchronous > webseerver, where requests come in, queue up the request and immediately > send a success response to the user. I am planning on having a separate > process polling this queue and handling the requests. > > what i had in mind was something like: > while(1) do > queue.first.handle() > sleep(1) > end > > I know Mongrel is single threaded so I was planning on using a > multithreaded server like Thin or LiteSpeed. > > > Any thoughts? > > Thanks! > > -Omri > -- > Posted via http://www.ruby-forum.com/. > >