Created
September 5, 2009 18:51
-
-
Save agustingianni/181483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Apr 21, 2009 | |
@author: gr00vy | |
''' | |
from sets import Set | |
from time import sleep | |
JOB_STATE_FINISHED = 0 | |
JOB_STATE_RUNNING = 1 | |
JOB_STATE_ABORTED = 2 | |
JOB_STATE_INITIALIZING = 3 | |
class Job: | |
''' | |
Un Job esta compuesto por muchas Task's | |
''' | |
def __init__(self, name=None): | |
self.id = 10 | |
self.name = name | |
self.job_tasks = Set() | |
self.state = JOB_STATE_INITIALIZING | |
def getName(self): | |
return self.name | |
def runJob(self, worker): | |
print "Running job from %s" %(worker.getName()) | |
sleep(5) | |
return "Sleeeeeep task" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment