Skip to content

Conversation

tronical
Copy link
Member

…ttp requests with Slint

This is a little "stock ticker" that when manually refreshed uses async Rust and Python APIs to request new prices from a website and update a Slint model.

In Rust, this demonstrates the use of slint::spawn_local() and in Python the use of our asyncio integration.

@tronical tronical force-pushed the simon/stock-ticker branch 2 times, most recently from 580ef07 to b93beb6 Compare September 22, 2025 07:02
Comment on lines 13 to 21
{
name: "AAPL",
price: 237.96,
},
{
name: "MSFT",
price: 509.24,
},
{ name: "AMZN", price: 232.94 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this default value was used to develop the UI in the first place, but now it's kind of useless because it's immediately replaced with the contents of the model coming from the backend? How about making this an empty array here?

(as is, it's a bit confusing because "AMZN.US" != "AMZN" and because this data is - if I'm not missing anything - basically not used)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we tend to have some data in there so that the live-preview doesn't show an empty ui. I'll change it to clarify with a comment that this is to be replaced at run-time and I'll sync the ticker symbols.

@tronical
Copy link
Member Author

Renamed to examples/async-io as discussed with Olivier and added a quick README.

…ttp requests with Slint

This is a little "stock ticker" that when manually refreshed uses async Rust and Python APIs
to request new prices from a website and update a Slint model.

In Rust, this demonstrates the use of `slint::spawn_local()` and in Python the use of our
asyncio integration.
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.

3 participants