From: Brian Candler Date: 2012-09-03T21:12:45+09:00 Subject: Re: working on multiple machines in a LAN ajay paswan wrote in post #1074428: > Can we guarantee that we use all machine whenever it gets free? and same > task should not run more than once? > > What about: starfish (http://rufy.com/starfish/doc/)? > > What if I use simple socket programming? I mean a chat server will help > distribute the works? Sure there are lots of solutions. Choose one, try it out. If it doesn't meet your needs, try another. If your code is modular, it should be straightforward to connect your actual worker code to any of these frameworks. At the simplest level you can have a Queue object (from thread.rb) and share it using DRb; the workers call q.pop and they will block until a job is available. I've done that before. One I haven't used is Rinda. I haven't used Starfish either. Like you say, you can do something directly with Socket, or gserver.rb. The lower-level you go, the more work you'll probably have to do around handling error conditions and retries. I mention Resque because I've used it myself. It comes with a web interface which lets you see the queued jobs, the running workers, what each worker is doing, and failed jobs - you can trigger retries via the web interface. If that's something you need in your application, then this will save you work implementing it yourself. What resque is not so strong at is passing the results back from a particular worker, or notifying a central point when a job has completed. -- Posted via http://www.ruby-forum.com/.