Author primal
Recipients aeros, asvetlov, primal, yselivanov
Date 2019-11-01.11:45:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572608759.25.0.415713676345.issue32309@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-11-01 11:45:59primalsetrecipients: + primal, asvetlov, yselivanov, aeros
2019-11-01 11:45:59primalsetmessageid: <1572608759.25.0.415713676345.issue32309@roundup.psfhosted.org>
2019-11-01 11:45:59primallinkissue32309 messages
2019-11-01 11:45:59primalcreate