Author antoine.pietri
Recipients antoine.pietri, asvetlov, cjrh, primal, yselivanov
Date 2019-10-12.11:39:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAOMH6m2OqOLiEKMr+RC+Ef-jw5_qVURZpLM6_=1qQu_AuRqrtQ@mail.gmail.com>
In-reply-to <1570879446.69.0.504074792483.issue38306@roundup.psfhosted.org>
Content
On Sat, Oct 12, 2019 at 1:24 PM Caleb Hattingh <report@bugs.python.org> wrote:
> Even before task groups land, this API can be easily improved by adding
>
> asyncio.run_in_executor(func, *args, **kwargs)
>
> - Only valid inside a coro or async context (uses get_running_loop internally)
> - Analogous to how `loop.create_task` became `asyncio.create_task`
> - Drop having to specify `None` for the default executor
> - Users already know the `run_in_executor` name
> - Allow both positional and kwargs (we can partial internally before calling loop.run_in_executor)

I think it should be run_thread() if it only works for thread.
run_in_executor() should take an executor= parameter, but it wouldn't
be as clear for beginners. I think there's value in having a simple,
explicit way of saying "I want to run this function in a thread"
without having to know what executors are.
History
Date User Action Args
2019-10-12 11:39:45antoine.pietrisetrecipients: + antoine.pietri, asvetlov, cjrh, yselivanov, primal
2019-10-12 11:39:44antoine.pietrilinkissue38306 messages
2019-10-12 11:39:44antoine.pietricreate