Skip to content

Commit

Permalink
VPollerWorker class now extends multiprocessing.Process
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 3, 2014
1 parent b1a5076 commit 937e32b
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/vpoller/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,37 @@ class VPollerWorker(multiprocessing.Process):
"""
VPollerWorker class
Prepares all vSphere Agents for polling from the vSphere hosts.
A vPoller Worker object runs the vSphere Agents, which are
responsible for making vSphere API requests
This is the main vPoller Worker, which runs the vSphere Agents
Extends:
Daemon class
multiprocessing.Process
Overrides:
run() method
"""
def run(self, config):
def __init__(self, db, proxy):
"""
Initialize a new VPollerWorker object
Args:
db (str): Path to the vConnector database file
proxy (str): Endpoint from which the vPoller Worker receives new tasks
"""
super(VPollerWorker, self).__init__()
self.config = {
'db': db,
'proxy': proxy,
}
self.time_to_die = multiprocessing.Event()
self.agents = {}
self.zcontext = None
self.zpoller = None
self.worker_socket = None

def run(self):
"""
The main worker method.
Expand Down

0 comments on commit 937e32b

Please sign in to comment.