aboutsummaryrefslogtreecommitdiff
path: root/rpki/async.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpki/async.py')
-rw-r--r--rpki/async.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpki/async.py b/rpki/async.py
index f2abd05d..5b3d35b1 100644
--- a/rpki/async.py
+++ b/rpki/async.py
@@ -352,8 +352,9 @@ class sync_wrapper(object):
err = None
fin = False
- def __init__(self, func):
+ def __init__(self, func, disable_signal_handlers = False):
self.func = func
+ self.disable_signal_handlers = disable_signal_handlers
def cb(self, res = None):
"""
@@ -389,7 +390,10 @@ class sync_wrapper(object):
self.eb(e)
event_defer(thunk)
- event_loop()
+ if self.disable_signal_handlers:
+ event_loop(catch_signals = ())
+ else:
+ event_loop()
if not self.fin:
logger.warning("%r event_loop terminated without callback or errback", self)
if self.err is None: