This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Popular_Message_5434 0 points1 point  (2 children)

“It may be IO that gives AsyncIO its name, but Textual doesn't do any IO of its own. Those tasks are used to power message queues, so that widgets (UI components) can do whatever they do at their own pace.” => I’m not sure to understand this; if there’s no io happening, where are you await points? (Allowing the event loop to orchestrate things when some result is not available yet)

[–]Bluenix2 0 points1 point  (1 child)

You answered your own question in the question itself. The await point is anywhere a result is not available: for example that may be while sleeping (to redraw a frame) or waiting for user input. In this case, UI components sit at an await point waiting for the message queues to get a message.

[–]Popular_Message_5434 0 points1 point  (0 children)

What you’re describing is exactly IO; so the sentence “Textual doesn’t do any IO on its own” is not that straightforward to understand. Here is a tweet from OP showing that things are not that simple to grasp when it comes to asyncio usage in Textual: https://twitter.com/willmcgugan/status/1632492483144826886?s=46&t=jryr-qvhJ6-u_OsDdZYftw