Process and stores the results to disk using the diskcache library. There are currently two options:Ī DiskCache backend that runs callback logic in a separate You can configure a callback to run in the background by setting background=True on the callback.Ĭallbacks with background=True use a backend configured by you to run the callback logic. In the order that they came in by dedicated queue worker(s). In the background queue, the callbacks are executed one-by-one
Background callbacks offer a scalable solution for using long-runningĬallbacks by running them in a separate background queue. Workers, preventing other requests from going through.
While you can increase the timeout on the web server, you risk allowing long-running callbacks to use all of your app’s Most web servers have a 30 second timeout by default, which is an issue for callbacks that take longer to complete. To get the most out of this page, make sure you’ve read aboutīasic Callbacks in the Dash Fundamentals. If you’re using an earlier version of Dash 2.x, you can use long_callback for long-running callbacks. Support for background callbacks on was introduced in Dash 2.6.