-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
The running keyword in callbacks currently only works when background=True
is set for callbacks. However, sometimes you have a normal callback, that takes a while to execute, that you don't want to turn in a background callback, but which you do want to have running functionality for.
Currently, I solve this by manually creating a callback loop, i.e. by having an entry-exit callback that disables/enables the button which then triggers a second callback that does the actual calculation. But that is a bit cumbersome to set up every time, since you have to be careful to make sure that the loop properly closes. For example, if you run the same calculation twice consecutively, the exit callback might not be triggered the second time because the calculation return data didn't change compared to the first run and therefore Dash won't update the component that triggers the loop exit condition. (The solution is to add extra data that will always update, e.g. a calculation counter)
Having this functionality enabled via the running keyword that already works for background callbacks would be amazing.