##// END OF EJS Templates
events: Add comments to the subcriber classes.
Martin Bornhold -
r1020:b4758185 default
parent child Browse files
Show More
@@ -78,6 +78,9 b' def scan_repositories_if_enabled(event):'
78
78
79
79
80 class Subscriber(object):
80 class Subscriber(object):
81 """
82 Base class for subscribers to the pyramid event system.
83 """
81 def __call__(self, event):
84 def __call__(self, event):
82 self.run(event)
85 self.run(event)
83
86
@@ -86,6 +89,12 b' class Subscriber(object):'
86
89
87
90
88 class AsyncSubscriber(Subscriber):
91 class AsyncSubscriber(Subscriber):
92 """
93 Subscriber that handles the execution of events in a separate task to not
94 block the execution of the code which triggers the event. It puts the
95 received events into a queue from which the worker process takes them in
96 order.
97 """
89 def __init__(self):
98 def __init__(self):
90 self._stop = False
99 self._stop = False
91 self._eventq = Queue.Queue()
100 self._eventq = Queue.Queue()
@@ -113,6 +122,10 b' class AsyncSubscriber(Subscriber):'
113
122
114
123
115 class AsyncSubprocessSubscriber(AsyncSubscriber):
124 class AsyncSubprocessSubscriber(AsyncSubscriber):
125 """
126 Subscriber that uses the subprocess32 module to execute a command if an
127 event is received. Events are handled asynchronously.
128 """
116
129
117 def __init__(self, cmd, timeout=None):
130 def __init__(self, cmd, timeout=None):
118 super(AsyncSubprocessSubscriber, self).__init__()
131 super(AsyncSubprocessSubscriber, self).__init__()
General Comments 0
You need to be logged in to leave comments. Login now