Skip to content

Commit

Permalink
Clarify how 'sender' kwarg works
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag authored and ask committed Aug 14, 2019
1 parent 4b8e3a9 commit 3fec8a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/userguide/subscribers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Subscribers are stored in the database.

The subscription can match an event by simple pattern matching,
and also filter by events related to a specific user (requires
the event to be sent with a ``sender`` argument``).
the event to be sent with a ``sender`` argument).

A simple subscriber can be created from the repl,
like in this example where all ``article.`` related events
Expand All @@ -32,3 +32,9 @@ and the payload is requested to be in *json* format:
url='http://example.com/receive/article',
content_type='application/json',
... )
Sending events to only a subset of subscribers
----------------------------------------------
Thorn can send an event either to all subscribers or to the single subscriber
whose :attr:`~thorn.generic.models.AbstractSubscriber.user` attribute matches
the ``sender`` keyword argument passed to :meth:`~thorn.events.Event.send`.

0 comments on commit 3fec8a0

Please sign in to comment.