Create app.timer
for timing UI-independent functions
#3225
Replies: 4 comments 7 replies
-
any progress? |
Beta Was this translation helpful? Give feedback.
-
I know I'm a bit late to the party, given that a PR is already in the works, but I've been using a variant of this package along with an https://fastapi-utils.davidmontague.xyz/user-guide/repeated-tasks/#the-repeat_every-decorator I do like the idea of the timer being implemented as a decorator function versus how I expect the version in the PR will work. |
Beta Was this translation helpful? Give feedback.
-
Another thought, perhaps for a later version, would be to extend this proposed app level timer capabilities to run functions at specific times. A simpler implementation might allow a user to just schedule a function at 6.00am each day whilst a more advanced version might allow for every Tuesday at 6.00am or the 15th of every Month. |
Beta Was this translation helpful? Give feedback.
-
Let's discuss ideas like |
Beta Was this translation helpful? Give feedback.
-
As discussed in #3187,
ui.timer
works like a UI element: It starts running when a page is created and stops when removing the timer or its parent container. This is handy in some cases, but isn't very helpful in others.Therefore we propose an
app.timer
function that behaves similar toui.timer
, but runs on an app level, independent of connected clients. It will, however, have no UI context to work with. So it is primarily meant to run non-UI code.Beta Was this translation helpful? Give feedback.
All reactions