Ravenports generated: 24 Feb 2024 23:39
[ravenports.git] / bucket_4C / python-rq
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-rq
4 VERSION=                1.16.0
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
7 SDESC[v11]=             Library for procesing background jobs (3.11)
8 SDESC[v12]=             Library for procesing background jobs (3.12)
9 HOMEPAGE=               https://python-rq.org/
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/84/62/9a6b14d4a724607f740cc4b3d132c52af24e753fe2a958d0b8c9d6d24e0a
14 DISTFILE[1]=            rq-1.16.0-py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               rq-1.16.0.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-click:single:v11
29                                         python-redis:single:v11
30 [PY311].USES_ON=                        python:v11,wheel
31
32 [PY312].RUN_DEPENDS_ON=                 python-click:single:v12
33                                         python-redis:single:v12
34 [PY312].USES_ON=                        python:v12,wheel
35
36 [FILE:2206:descriptions/desc.single]
37 RQ (_Redis Queue_) is a simple Python library for queueing jobs and
38 processing
39 them in the background with workers.  It is backed by Redis and it is
40 designed
41 to have a low barrier to entry.  It should be integrated in your web stack
42 easily.
43
44 RQ requires Redis >= 3.0.0.
45
46 [Build status]
47 [PyPI]
48 [Coverage]
49 [![Code style: black]](https://github.com/psf/black)
50
51 Full documentation can be found [here][d].
52
53 ## Support RQ
54
55 If you find RQ useful, please consider supporting this project via
56 [Tidelift].
57
58 ## Getting started
59
60 First, run a Redis server, of course:
61
62 ```console
63 $ redis-server
64 ```
65
66 To put jobs on queues, you don't have to do anything special, just define
67 your typically lengthy or blocking function:
68
69 ```python
70 import requests
71
72 def count_words_at_url(url):
73     """Just an example function that's called async."""
74     resp = requests.get(url)
75     return len(resp.text.split())
76 ```
77
78 You do use the excellent [requests][r] package, don't you?
79
80 Then, create an RQ queue:
81
82 ```python
83 from redis import Redis
84 from rq import Queue
85
86 queue = Queue(connection=Redis())
87 ```
88
89 And enqueue the function call:
90
91 ```python
92 from my_module import count_words_at_url
93 job = queue.enqueue(count_words_at_url, 'http://nvie.com')
94 ```
95
96 Scheduling jobs are also similarly easy:
97
98 ```python
99 # Schedule job to run at 9:15, October 10th
100 job = queue.enqueue_at(datetime(2019, 10, 10, 9, 15), say_hello)
101
102 # Schedule job to run in 10 seconds
103 job = queue.enqueue_in(timedelta(seconds=10), say_hello)
104 ```
105
106 Retrying failed jobs is also supported:
107
108 ```python
109 from rq import Retry
110
111 # Retry up to 3 times, failed job will be requeued immediately
112 queue.enqueue(say_hello, retry=Retry(max=3))
113
114 # Retry up to 3 times, with configurable intervals between retries
115 queue.enqueue(say_hello, retry=Retry(max=3, interval=[10, 30, 60]))
116 ```
117
118 For a more complete example, refer to the [docs][d].  But this is the
119 essence.
120
121 ### The worker
122
123 To start executing enqueued function calls in the background, start a
124 worker
125 from your project's directory:
126
127 ```console
128 $ rq worker --with-scheduler
129 *** Listening for work on default
130 Got count_words_at_url('http://nvie.com') from default
131 Job result = 818
132 *** Listening for work on default
133 ```
134
135 That's about it.
136
137
138
139 [FILE:105:distinfo]
140 d71859da6f3af597bd79675b240e138587878ce9b693d1bcf681443e2a8193ce        89628 rq-1.16.0-py3-none-any.whl
141