I want to run a callback to update a graph every 10 seconds , but sometimes the data that the callback might need to process can be more and the call back might not finish is there a way to make dcc.Interval run every n_interval only if call back finishes
There may be many reasons for this. Does your dataset is so large? Or are you reading your csv in every callback (so 10 time in a page) or your read_data query that read data from SQL could take more time.
I did dcc interval 40second. And it refresh itself in 5 second this is bc my dataset size. When i try to read from SQL i having a speed problem.
Actually i see some study about dash with dask about this. And yesterday i search something about dash with pyspark. So we (you and me) could make intermediate steps faster i think.
But if you read dataset 10 times in a dash page this problem could be solved. You can check here https://dash.plotly.com/sharing-data-between-callbacks This technique make my dashboard page 3time faster.
You could try LRU cache,
I think Celery would be a better option though, but the setup is a little more elaborate. Here is a small example,