threadsafe create_task from asyncio
(self, coro, cb=None)
| 178 | future.set_result(task) |
| 179 | |
| 180 | def create_task(self, coro, cb=None): |
| 181 | """ |
| 182 | threadsafe create_task from asyncio |
| 183 | """ |
| 184 | future = Future() |
| 185 | p = functools.partial(self._create_task, future, coro, cb) |
| 186 | self.loop.call_soon_threadsafe(p) |
| 187 | return future.result() |
| 188 | |
| 189 | def run_coro_and_wait(self, coro): |
| 190 | cond = threading.Condition() |