-
First Check
Example Codedef start_background_loop() -> None:
# need to loop over every user
print(app.storage.user)
app.on_startup(start_background_loop)DescriptionI need to loop over all users storage and update one value (basically long running background function that does something on each user behalf and then stores some data in user storage thus triggering reactive ui changes for each user) NiceGUI Version3.3.1 Python Version3.13 BrowserFirefox Operating SystemLinux Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Answered by
evnchn
Nov 29, 2025
Replies: 1 comment 1 reply
-
|
Hello @masterjg I used to do this. It works but may break since async def start_background_loop() -> None:
while True:
print(app.storage._users)
await asyncio.sleep(1)Cheers! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
masterjg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @masterjg
I used to do this. It works but may break since
._usersis private attribute.Cheers!