JOGAPY : A Very Simple Job Distribution System

By | October 19, 2011

A few days ago  I was learning the use of  Gearman . Then I thought why don’t I try to make a simple job distribution system like it using python. So I developed one and I call it JOGAPY .

Download it.

You can make a job server this way:

from jogapy.server import *
server = JogapyServer(‘localhost’,3277)

Now save it as . It will start the job server if you execute it.

Here is the code of a client.

from jogapy.client import *
client = JogapyClient((‘localhost’,3277))
for result in client.results():
print result.result

Save it as . Now let’s make a worker.

from jogapy.worker import *
def echo(say):
return say

worker = JogapyWorker([('localhost',3277)])

Save the code as and execute it.

If you run the it will request the job server to process the echo function for it. If any free worker is connected with the server who can process the echo function the job server will tell him to do it. The worker will receive task info and it will start the process. When the task will be complete it will tell the server that the task is complete and it will send the task result to the server. Then the job server will send the task result to the client.

3 thoughts on “JOGAPY : A Very Simple Job Distribution System

  1. Pingback: JogaPY : PHP Example | My Blog

  2. Pingback: Jogapy : A Job Server Based On PHP | My Blog

  3. Pingback: 2011 | My Blog

Leave a Reply

Your email address will not be published. Required fields are marked *