Fix worker example (#1765)

* Fix worker example

* Clean worker example

* Improve docs
main
lowercase00 2 years ago committed by GitHub
parent bd07310253
commit 2c4c948207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -116,18 +116,14 @@ A simple implementation example:
```python
#!/usr/bin/env python
import sys
from rq import Connection, Worker
from redis import Redis
from rq import Worker
# Preload libraries
import library_that_you_want_preloaded
# Provide queue names to listen to as arguments to this script,
# similar to rq worker
with Connection():
qs = sys.argv[1:] or ['default']
w = Worker(qs)
# Provide the worker with the list of queues (str) to listen to.
w = Worker(['default'], connection=Redis())
w.work()
```

Loading…
Cancel
Save