Skip to content

Commit 63a2d73

Browse files
committed
Add GroupCallbacks to reference documentation
1 parent 1eaf7fe commit 63a2d73

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

docs/source/global.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.. |Encoders| replace:: :class:`Encoders<dramatiq.Encoder>`
1212
.. |GenericActors| replace:: :class:`class-based actors<dramatiq.GenericActor>`
1313
.. |Groups| replace:: :func:`Groups<dramatiq.group>`
14+
.. |GroupCallbacks| replace:: :class:`GroupCallbacks<dramatiq.middleware.GroupCallbacks>`
1415
.. |Interrupt| replace:: :class:`Interrupt<dramatiq.middleware.Interrupt>`
1516
.. |MemcachedRLBackend| replace:: :class:`Memcached<dramatiq.rate_limits.backends.MemcachedBackend>`
1617
.. |Messages| replace:: :class:`Messages<dramatiq.Message>`

docs/source/reference.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ The following middleware classes are available, but not enabled by default.
110110
.. autoclass:: dramatiq.middleware.CurrentMessage
111111
:members: get_current_message
112112
:member-order: bysource
113+
.. autoclass:: dramatiq.middleware.GroupCallbacks
113114
.. autoclass:: dramatiq.middleware.prometheus.Prometheus
114115

115116
.. py:class:: dramatiq.results.Results

dramatiq/composition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def add_completion_callback(self, message):
206206
callbacks.
207207
208208
Warning:
209-
This functionality is dependent upon the GroupCallbacks
209+
This functionality is dependent upon the optional |GroupCallbacks|
210210
middleware. If that's not set up correctly, then calling
211211
run after adding a callback will raise a RuntimeError.
212212

dramatiq/middleware/group_callbacks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727

2828
class GroupCallbacks(Middleware):
29+
"""Middleware that enables adding completion callbacks to |Groups|."""
30+
2931
def __init__(self, rate_limiter_backend: RateLimiterBackend) -> None:
3032
self.rate_limiter_backend = rate_limiter_backend
3133

0 commit comments

Comments
 (0)