Currently long_callback requires the app object, ie @app.long_callback. It will cause circular imports if you try to include it in the pages/ folder. However, it’s still possible to use it in this multi-page environment.
The workaround is to put the @app.long_callback in the app.py file. The layout and any other @callbacks can be in the pages/ folder.
Hi @icescreamsandwic I removed the example because app.long_callback had some bugs. The good news is that it was fixed in the latest dash release 2.6.0.
long_callback has been completely refactored - you can see a preview in the pull request. The announcement and docs are coming soon.
You can use a dash.callback and add background=True to convert it to a long callback. The previous long callback arguments (like cancel, running, etc) can now be moved to dash.callback
There are a couple other changes to be aware of that haven’t been updated in the docs yet, as I’ve just discovered. Configuration of the celery manager should now look like this:
Thanks for sharing @james_cultivarium . The updated docs for the long callback and the rest of Dash 2.6.0 are being written as we speak. We hope to publish them by end of next week.