Show More
@@ -78,6 +78,9 b' def scan_repositories_if_enabled(event):' | |||
|
78 | 78 | |
|
79 | 79 | |
|
80 | 80 | class Subscriber(object): |
|
81 | """ | |
|
82 | Base class for subscribers to the pyramid event system. | |
|
83 | """ | |
|
81 | 84 | def __call__(self, event): |
|
82 | 85 | self.run(event) |
|
83 | 86 | |
@@ -86,6 +89,12 b' class Subscriber(object):' | |||
|
86 | 89 | |
|
87 | 90 | |
|
88 | 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 | 98 | def __init__(self): |
|
90 | 99 | self._stop = False |
|
91 | 100 | self._eventq = Queue.Queue() |
@@ -113,6 +122,10 b' class AsyncSubscriber(Subscriber):' | |||
|
113 | 122 | |
|
114 | 123 | |
|
115 | 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 | 130 | def __init__(self, cmd, timeout=None): |
|
118 | 131 | super(AsyncSubprocessSubscriber, self).__init__() |
General Comments 0
You need to be logged in to leave comments.
Login now