git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5ef20e
)
Make event waiting/notification generic
author
Sapan Bhatia
<gwsapan@gmail.com>
Wed, 3 Sep 2014 04:38:26 +0000
(
00:38
-0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Wed, 3 Sep 2014 04:38:26 +0000
(
00:38
-0400)
planetstack/ec2_observer/event_loop.py
patch
|
blob
|
history
diff --git
a/planetstack/ec2_observer/event_loop.py
b/planetstack/ec2_observer/event_loop.py
index
12e88ab
..
caabd1e
100644
(file)
--- a/
planetstack/ec2_observer/event_loop.py
+++ b/
planetstack/ec2_observer/event_loop.py
@@
-49,16
+49,16
@@
class PlanetStackObserver:
else:
self.driver = NoOpDriver()
else:
self.driver = NoOpDriver()
- def wait_for_event(self, timeout):
-
self.event_
cond.acquire()
-
self.event_
cond.wait(timeout)
-
self.event_
cond.release()
+ def wait_for_event(self, timeout
, cond=self.event_cond
):
+ cond.acquire()
+ cond.wait(timeout)
+ cond.release()
- def wake_up(self):
+ def wake_up(self
, cond=self.event_cond
):
logger.info('Wake up routine called. Event cond %r'%self.event_cond)
logger.info('Wake up routine called. Event cond %r'%self.event_cond)
-
self.event_
cond.acquire()
-
self.event_
cond.notify()
-
self.event_
cond.release()
+ cond.acquire()
+ cond.notify()
+ cond.release()
def load_sync_step_modules(self, step_dir=None):
if step_dir is None:
def load_sync_step_modules(self, step_dir=None):
if step_dir is None: