Message355811
Good points. I made a mistake in run Should be: async def run(self, func, *args, **kwargs): call = functools.partial(func, *args, **kwargs) return await self._loop.run_in_executor(self._executor, call) Also in this case run awaits and returns the result. Yury suggested earlier just to return the future and not await. I have no strong opinion either way. The above example does seem more higher level but Yury's example is more flexible. I agree that shutdown_default_executor and _do_shutdown should be changed to accept an executor argument so that any executor can be shutdown asynchronously. So the loop API would have a shutdown_executor method. shutdown_default_executor would just call shutdown_executor with the default executor as argument. That would be a good first step. | |
| Date | User | Action | Args | | 2019-11-01 11:45:59 | primal | set | recipients: + primal, asvetlov, yselivanov, aeros | | 2019-11-01 11:45:59 | primal | set | messageid: <1572608759.25.0.415713676345.issue32309@roundup.psfhosted.org> | | 2019-11-01 11:45:59 | primal | link | issue32309 messages | | 2019-11-01 11:45:59 | primal | create | | |