Run the func and send results back in a queue as a tuple of (`error`, `value`)
()
| 125 | results = Queue() |
| 126 | |
| 127 | def runner(): |
| 128 | """ |
| 129 | Run the func and send results back in a queue as a tuple of |
| 130 | (`error`, `value`) |
| 131 | """ |
| 132 | try: |
| 133 | _res = func(*(args or ()), **(kwargs or {})) |
| 134 | results.put((NO_ERROR, _res,)) |
| 135 | except Exception: |
| 136 | results.put((ERROR_MSG + traceback_format_exc(), NO_VALUE,)) |
| 137 | |
| 138 | tid = start_new_thread(runner, ()) |
| 139 |