Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-110771: Decompose run_forever() into parts#110773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
a0c1fde67bfc8f3dcf97b35271dc6672f6854349c3e6226a523852d0e7f892ef94494431431261b3e3d8File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -210,6 +210,44 @@ Running and stopping the loop | ||||||
| .. versionchanged:: 3.12 | ||||||
| Added the *timeout* parameter. | ||||||
| .. method:: loop.run_forever_setup() | ||||||
| Set up an event loop so that it is ready to start actively looping and | ||||||
| processing events. | ||||||
| Returns the state that must be restored when the loop concludes. This state | ||||||
| should be passed in as arguments to :meth:`loop.run_forever_cleanup()`. | ||||||
| ||||||
| should be passed in asarguments to:meth:`loop.run_forever_cleanup()`. | |
| should be passed in asargument to:meth:`loop.run_forever_cleanup()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No longer relevant as I've moved this to be an internal variable.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe this? Or maybe I misunderstand and the subclass wouldcall this and the cleanup method?
| This method is only needed if you are writing your own ``EventLoop`` | |
| Overriding this method is only needed if you are writing your own ``EventLoop`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The usage I'm envisaging (and the usage that would be needed by Toga would be tocall the startup/cleanup methods, but provide a custom "while True: process event" loop that does whatever is needed for integration.
Overriding may also be required - the Windows event loop does this. However, I suspect that's more a case of Python's implementation using subclassing to satisfy the needs of all platforms, rather than something you'll see with GUI integration.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe stronger?
| end userswill notneed to use this method directly. | |
| end usersshould notcall this method directly. |
Also below.
Also, I'd like to see a tiny example of how to write such a subclass.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe say something about whether this is re-entrant? Should I worry about not calling it twice?
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| The *original_state* argument is the return valueprovided by the call to | |
| The *original_state* argument is the return valuefrom the call to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No longer relevant as I've moved this to be an internal variable.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Same as above.