Provides a generator of tasks for imap and imap_unordered with appropriate handling for iterables which throw exceptions during iteration.
(self, result_job, func, iterable)
| 383 | callback, error_callback) |
| 384 | |
| 385 | def _guarded_task_generation(self, result_job, func, iterable): |
| 386 | '''Provides a generator of tasks for imap and imap_unordered with |
| 387 | appropriate handling for iterables which throw exceptions during |
| 388 | iteration.''' |
| 389 | try: |
| 390 | i = -1 |
| 391 | for i, x in enumerate(iterable): |
| 392 | yield (result_job, i, func, (x,), {}) |
| 393 | except Exception as e: |
| 394 | yield (result_job, i+1, _helper_reraises_exception, (e,), {}) |
| 395 | |
| 396 | def imap(self, func, iterable, chunksize=1): |
| 397 | ''' |
no test coverage detected