beowulfey
beowulfey6mo ago

Refresh

Hi all! Just a simple question about the Refresh feature. I'm trying to refresh at rates <1 second, but even though it accepts times less than 1 second it appears to still be refreshing at 1 second. Here's a simple example: https://marimo.app/l/wlfaxb Am I doing something wrong or is this maybe a bug of some kind?
marimo | a next-generation Python notebook
Explore data and build apps seamlessly with marimo, a next-generation Python notebook.
5 Replies
Myles Scolnick
Myles Scolnick6mo ago
That is intentional. The refresh is more of a user interaction. Even sub 1 second won’t be accurate because since it’s a frontend refresh, you’ll hit network latencies. Can you do while loop with async sleep?
beowulfey
beowulfeyOP6mo ago
Ah okay good to know. I had seen a commit that allowed for <1 second times so I thought it was possible now. I think async sleep should work, I'll give that a try!
Myles Scolnick
Myles Scolnick6mo ago
There’s just overhead that probably increases the subsecond
beowulfey
beowulfeyOP6mo ago
By any chance do you know of any examples that use async upon user interaction? Like upon a button press? Trying to figure it out but having trouble
Myles Scolnick
Myles Scolnick6mo ago
which part? the button press to run something or the async refresh/loop?