Args: num_workers: Number of worker processes to run in parallel. heartbeat_timeout: Timeout in seconds for waiting for results. Each time the timeout is reached, a heartbeat is signalled and timeout is reset. notify_function: Callable called to signal some events li
(self, num_workers=1, heartbeat_timeout=1, notify_function=None)
| 200 | self.done_queue = Queue() |
| 201 | |
| 202 | def init(self, num_workers=1, heartbeat_timeout=1, notify_function=None): |
| 203 | """ |
| 204 | Args: |
| 205 | num_workers: Number of worker processes to run in parallel. |
| 206 | heartbeat_timeout: Timeout in seconds for waiting for results. Each time |
| 207 | the timeout is reached, a heartbeat is signalled and timeout is reset. |
| 208 | notify_function: Callable called to signal some events like termination. The |
| 209 | event name is passed as string. |
| 210 | """ |
| 211 | self.num_workers = num_workers |
| 212 | self.heartbeat_timeout = heartbeat_timeout |
| 213 | self.notify = notify_function or (lambda x: x) |
| 214 | |
| 215 | def add_jobs(self, jobs): |
| 216 | self.add(jobs) |
no outgoing calls