Compute task and handle all administration See Also -------- _execute_task : actually execute task
(key, task_info, dumps, loads, get_id, pack_exception)
| 244 | |
| 245 | |
| 246 | def execute_task(key, task_info, dumps, loads, get_id, pack_exception): |
| 247 | """ |
| 248 | Compute task and handle all administration |
| 249 | |
| 250 | See Also |
| 251 | -------- |
| 252 | _execute_task : actually execute task |
| 253 | """ |
| 254 | try: |
| 255 | task, data = loads(task_info) |
| 256 | result = task(data) |
| 257 | id = get_id() |
| 258 | result = dumps((result, id)) |
| 259 | failed = False |
| 260 | except BaseException as e: |
| 261 | result = pack_exception(e, dumps) |
| 262 | failed = True |
| 263 | return key, result, failed |
| 264 | |
| 265 | |
| 266 | def batch_execute_tasks(it): |
no test coverage detected