Skip to content
Snippets Groups Projects
Commit 159c4c29 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Modified to provide a generic behavior for a task or a set of tasks.

parent d8c4fed1
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ from config import Config
from job_queue import JobQueue
class Preprocessor(Process):
class TaskExecutor(Process):
def __init__(self):
config = Config("vos_ts.conf")
......@@ -14,13 +14,19 @@ class Preprocessor(Process):
self.maxPendingJobs = self.params.getint("max_pending_jobs")
self.maxReadyJobs = self.params.getint("max_ready_jobs")
self.execWaitTime = self.params.getint("exec_wait_time")
self.pendingQueue = JobQueue("pending")
self.readyQueue = JobQueue("ready")
super(Preprocessor, self).__init__()
self.srcQueue = None
self.destQueue = None
super(TaskExecutor, self).__init__()
def wait(self):
time.sleep(self.execWaitTime)
def setSourceQueueName(self, srcQueueName):
self.srcQueue = JobQueue(srcQueueName)
def setDestinationQueueName(self, destQueueName):
self.destQueue = JobQueue(destQueueName)
def run(self):
"""
This method must be implemented by
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment