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.
This PR adds Windows support for
long_callback
.This primarily involved two changes:
multiprocess
library for running the background processes on Windows. This is an API compatible alternative to the built-in Pythonmultiprocessing
module that usesdill
for cross-process serialization (Rather than the built-inpickle
module). Unlike pickle,dill
can serializinglambda
functions and function closures. Serialization is not required at all on non-Windows platforms, so in these cases the regularmultiprocessing
module is used, and themultiprocess
package is not required.The documentation examples have been updated to remove the FlaskCaching backend, and replace it with the Diskcache backend. The Celery backend remains unchanged.