Skip to content

Add some useful helper classes#6

Open
glglgl-de wants to merge 1 commit into
asyncgui:mainfrom
glglgl-de:suggest-extensions
Open

Add some useful helper classes#6
glglgl-de wants to merge 1 commit into
asyncgui:mainfrom
glglgl-de:suggest-extensions

Conversation

@glglgl-de

Copy link
Copy Markdown

The combination of a Tkinter GUI with other frameworks in the background can make it necessary to communicate via concurrent.future.Future objects.

If we want to use their results, it might be useful to be able to await on them.

Other circumstances in the GUI might make it necessary to yield control for a short or even longer amount of time. If this can be done with await, we use the advantages of async/await to their full extent.

The combination of a Tkinter GUI with other frameworks in the background
can make it necessary to communicate via concurrent.future.Future objects.

If we want to use their results, it might be useful to be able to await on them.

Other circumstances in the GUI might make it necessary to yield control
for a short or even longer amount of time. If this can be done with await,
we use the advantages of async/await to their full extent.
@gottadiveintopython

Copy link
Copy Markdown
Member

Thank you for contributing to the project :)

I can see the motivation for supporting Future. However, is it really necessary to support it directly? What about extending run_in_executor to support arbitrary Executor implementations instead of just ThreadPoolExecutor, so that users don't have to deal with Future objects directly?

(I'm asking because I'm not very familiar with the concurrent.future module.)

@gottadiveintopython

gottadiveintopython commented Jul 4, 2026

Copy link
Copy Markdown
Member

I opend a pull request (#8) that extends run_in_executor.
Would it meet your needs?

@glglgl-de

Copy link
Copy Markdown
Author

Thanks for your reply. It already looks good, making use of what the Future object gives us. Probably on Monday or Tuesday, I'll find some time to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants