You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -129,15 +129,15 @@ Steady Queue will try to find our configuration under the `STEADY_QUEUE` variabl
129
129
from steady_queue.configuration import Configuration
130
130
from datetime import timedelta
131
131
132
-
STEADY_QUEUE= Configuration.ConfigurationOptions(
132
+
STEADY_QUEUE= Configuration.Options(
133
133
dispatchers=[
134
-
Configuration.DispatcherConfiguration(
134
+
Configuration.Dispatcher(
135
135
polling_interval=timedelta(seconds=1),
136
136
batch_size=500
137
137
)
138
138
],
139
139
workers=[
140
-
Configuration.WorkerConfiguration(
140
+
Configuration.Worker(
141
141
queues=["*"],
142
142
threads=3,
143
143
polling_interval=timedelta(seconds=0.1)
@@ -155,19 +155,19 @@ Here's an overview of the different options:
155
155
-`batch_size`: the dispatcher will dispatch tasks in batches of this size. The default is 500.
156
156
157
157
-`concurrency_maintenance_interval`: the time interval in seconds that the
158
-
dispatcher will wait before checking for blocked jobs that can be unblocked.
158
+
dispatcher will wait before checking for blocked tasks that can be unblocked.
159
159
Read more about [concurrency controls](#concurrency-controls) to learn more
160
160
about this setting. It defaults to `600` seconds.
161
161
162
162
-`queues`: the list of queues that workers will pick tasks from. You can use
163
163
`*` to indicate all queues (which is also the default and the behavior you'll
164
164
get if you omit this). Tasks will be polled from those queues in order, so for
165
-
example, with `['real_time', 'background']`, no jobs will be taken from
166
-
`background` unless there aren't any more jobs waiting in `real_time`.
165
+
example, with `['real_time', 'background']`, no tasks will be taken from
166
+
`background` unless there aren't any more tasks waiting in `real_time`.
167
167
168
168
You can also provide a prefix with a wildcard to match queues starting with a
169
169
prefix. For example adding `staging*` to the queues list will create a worker
170
-
fetching jobs from all queues starting with `staging`. The wildcard `*` is
170
+
fetching tasks from all queues starting with `staging`. The wildcard `*` is
171
171
only allowed on it's own or at the end of a queue name; you can't specify
172
172
queue names such as `*_some_queue`. These will be ignored.
173
173
@@ -388,9 +388,137 @@ TODO
388
388
389
389
## Concurrency controls
390
390
391
-
TODO
391
+
Steady Queue extends Django Tasks with concurrency controls, that allows you to limit how many tasks of a certain type or with certain arguments can run at the same time. When limited in this way, tasks will be blocked from running, and they'll stay blocked until another task finishes and unblocks them, or after the set expiry time (concurrency limit's _duration_) elapses. Tasks are never discarded or lost, just blocked.
392
+
393
+
394
+
```python
395
+
from django_tasks import task
396
+
397
+
from steady_queue.concurrency import limits_concurrency
0 commit comments