Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

long_callback: Switch from FlaskCaching to Diskcache and add windows support #32

Merged
merged 11 commits into from
Jul 7, 2021

Conversation

jonmmease
Copy link
Contributor

This PR adds Windows support for long_callback.

This primarily involved two changes:

  • Use the multiprocess library for running the background processes on Windows. This is an API compatible alternative to the built-in Python multiprocessing module that uses dill for cross-process serialization (Rather than the built-in pickle module). Unlike pickle, dill can serializing lambda functions and function closures. Serialization is not required at all on non-Windows platforms, so in these cases the regular multiprocessing module is used, and the multiprocess package is not required.
  • The FlaskCaching backend has been removed and replaced by a daskcache-based backend. With diskcache, the reference to the cache can be serialized across processes. This is not possible with FlaskCaching because the cache handle requires a reference to the full Flask app instance.

The documentation examples have been updated to remove the FlaskCaching backend, and replace it with the Diskcache backend. The Celery backend remains unchanged.

@jonmmease jonmmease merged commit a54ce9f into main Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant