SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

"What is it?"
I call it the Distributor Library Framework because there are several classes involved on both the client and server-sides.

"What does it do?"
It uses dRuby to distribute runnable objects to several clients.

["Hey, what are runnable objects?"
Objects which respond to a 'run' message. It doesn't matter what 'run' does.]

"What's it good for?"
It's good for distributing tasks to several clients. For example, let's say you need to run several thousand compiler testcases overnight (8 hours). And it takes two days to run all of them on one client, one day on two clients, 1/2 day on 4 clients, etc... Distributor lets you distribute these kinds of tasks to several clients, thus reducing the time you need to get results.

"How do I use it?"

You have a Distributor and some number of Clients. For real uses, you'll instantiate a Distributor in your server-side program and a Client object in your client-side program. But for now, take a look at the file Client.rb paying close attention to the bottom of the file after the if __FILE__ == $0

You'll notice that if you run: 'ruby Client.rb' on one or more of your client machines that it will instantiate a Client object. You can do the same with Distributor.rb by running:

ruby Distributor.rb [list of clients running Client.rb here]

on your designated Distributor machine.

There are runnable classes defined in Task.rb which get distributed to clients by Distributor in the test example. Task.rb is just included as an example of what you can do in your own 'runnable' classes (remember our definition of a 'runnable' object from above).

To summerize:
1) Choose your client machines and run on them: ruby Client.rb
2) Choose you Distributor machine and run: ruby Distributor.rb [list of clients running Client.rb here]

Looking at Distributor.rb and Task.rb will show you how to use Distributor to distribute your own custom runnable objects.

If you have any questions email me at:
rubyfan@programmer.net

"What license is this code covered by?" Same as Ruby's. But, hey, if you're using this in a commercial setting and you find that it saved you many hours that you would have spent developing your own distribution system, consider sending me a (totally voluntary) contribution so I can develop more (hopefully useful) Ruby modules. (Hey, I've gotta have some way to support this habit :-) Send me an email for more details.

Phil


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.