I am trying to using rq under windows 10, but get an error in worker:
File "c:\dev\src\rq\rq\worker.py", line 474, in work
self.execute_job(job, queue)
File "c:\dev\src\rq\rq\worker.py", line 592, in execute_job
self.fork_work_horse(job, queue)
File "c:\dev\src\rq\rq\worker.py", line 534, in fork_work_horse
child_pid = os.fork()
AttributeError: 'module' object has no attribute 'fork'
Limitations
RQ workers will only run on systems that implement fork(). Most notably, this means it is not possible to run the workers on Windows.
Windows Linux Subsystem supports FORK!!!
The way to get this working, is:
pip install rq
and then run the worker. In my case, I am running redis in a container at localhost:32768
So in following the samples they change so that you setup your connection and yoru worker like this:
q = Queue(connection=Redis(host="localhost", port="32768"))
rq worker --url redis://localhost:32768
See also Issue #937
os.fork() only works with Linux operating systems, and with Win10 you can use the cross-platform multiprocessing module
Most helpful comment
Windows Linux Subsystem supports FORK!!!
The way to get this working, is:
pip install rq
and then run the worker.In my case, I am running redis in a container at localhost:32768
So in following the samples they change so that you setup your connection and yoru worker like this:
q = Queue(connection=Redis(host="localhost", port="32768"))
rq worker --url redis://localhost:32768
See also Issue #937