You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The status of the event loop at the time user startup runs is not consistent across platforms. On Linux, iOS, Android, Web, and Textual, the event loop is running when the user's startup code runs....but it is not running on macOS and Windows. Therefore, users cannot use operations that require a running event loop such as calling asyncio.create_task().
Steps to reproduce
Call asyncio.create_task() from toga.App.startup().
Expected behavior
Ideally, the status of the event loop would be consistent across platforms. When it's not, users may experience confusing errors on one platform while their code works on another.
That said, I wouldn't consider this critical. But given this, we should be careful not to recommend operations in startup that require a running event loop to users or in docs. Additionally, now that toga.App.on_running() exists, users can simply do these types of things there instead of in startup().
Screenshots
No response
Environment
Operating System: all
Python version: all
Software versions:
Briefcase: 0.3.20.dev207
Toga: 0.4.7.dev59+gf379c61e7
Logs
No response
Additional context
Feel free to close if these differences aren't that important or if they are simply inherent to the platform.
The text was updated successfully, but these errors were encountered:
Some discrepancies between platforms are to be expected, but this is a pretty big one. Being unable to start an task from inside startup() is a substantial enough limitation, especially given the recent deprecation of add_background_task(), so I think it's worth addressing.
Describe the bug
The status of the event loop at the time user startup runs is not consistent across platforms. On Linux, iOS, Android, Web, and Textual, the event loop is running when the user's startup code runs....but it is not running on macOS and Windows. Therefore, users cannot use operations that require a running event loop such as calling
asyncio.create_task()
.Steps to reproduce
Call
asyncio.create_task()
fromtoga.App.startup()
.Expected behavior
Ideally, the status of the event loop would be consistent across platforms. When it's not, users may experience confusing errors on one platform while their code works on another.
That said, I wouldn't consider this critical. But given this, we should be careful not to recommend operations in startup that require a running event loop to users or in docs. Additionally, now that
toga.App.on_running()
exists, users can simply do these types of things there instead of instartup()
.Screenshots
No response
Environment
0.3.20.dev207
0.4.7.dev59+gf379c61e7
Logs
No response
Additional context
Feel free to close if these differences aren't that important or if they are simply inherent to the platform.
The text was updated successfully, but these errors were encountered: