Open BeastyBlacksmith opened 1 year ago
please let me know if I'm missing anything :smile:
Background callbacks in python dash were first called "long" callback. They were added via the @long_callback
decorator in https://github.com/plotly/dash/pull/1702, released as part of python dash v2.0.0
on 2021-08-03.
Long callbacks were then improved and effectively renamed "background" callbacks in https://github.com/plotly/dash/pull/2039 and https://github.com/plotly/dash/pull/2116, released in python dash v2.6.0
on 2022-07-14. This PR also refactored most of the functionality: the traditional callback
function (normally used as a @callback
decorator) gets a background=True
keyword argument. The @long_callback
decorator still exist to this day, but now is just a wrapper around callback(..., background=True)
.
Subsequent fixes and tweaks to background callbacks were made in:
The python dash callback
function has many keyword arguments to configure the "background" behaviour.
If background=True
, the extra callback registration logic is here and here. In brief, using a cache manager, we (1) build the cache key, (2) terminate old job if any, (3) call the callback function if cache miss. There's also logic for cancelling and an optional progress bar. This logic will have to be rewritten in Julia!
The supported cache managers are: Celery (paired with Redis) and Diskcache. That is, the python dash cache managers are wrappers around established python caching / queuing libraries. We should survey caching package in the Julia ecosystem that would work well for this use case. After a quick search, Dagger.jl look like a promising Celery-like package.
The extra clientside logic mostly is here and here (refer to .ts
file modifications in https://github.com/plotly/dash/pull/2039 for the details) . That part should just work :smile: but we'll need to make sure we send the appropriate JSON payload.
would translate to
Would be nice if we could support background callbacks on the julia side also.
Related to https://github.com/plotly/Dash.jl/issues/110