quamash icon indicating copy to clipboard operation
quamash copied to clipboard

Explicit QThreadExecutor necessary for loop.run_in_executor?

Open wolfgang-noichl opened this issue 6 years ago • 1 comments

When using asyncio without Quamash, loop.run_in_executor doesn't necessarily need an explicit thread executor. However, in Usage in readme.md it's given explicitly.

Is there any reason to do that, or can I just use loop.run_in_executor without an explicit executor as well?

wolfgang-noichl avatar Sep 06 '18 13:09 wolfgang-noichl

You don't need to specify the executor, since that's the API the loop is supposed to implent.

Personally, I think using run_in_executor without explicitly setting the executor is dumb.

That's why I don't do it in the examples.

What's happening internally is an executor is created by the loop's constructor which is then used if you don't specify one, but what kind of executor is used? How many threads/processes are in it? You have no idea and it's totally non obvious how to find out.

On Thu, Sep 6, 2018, 06:44 Wolfgang Noichl [email protected] wrote:

When using asyncio without Quamash, loop.run_in_executor doesn't necessarily need an explicit thread executor. However, in Usage in readme.md it's given explicitly.

Is there any reason to do that, or can I just use loop.run_in_executor without an explicit executor as well?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/harvimt/quamash/issues/98, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHRQiheXfpvCo_262dfWYohOxh8oaPSks5uYSaxgaJpZM4Wc9qN .

harvimt avatar Sep 06 '18 14:09 harvimt