mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
docs: Tweak some documentation around send_event.
This commit is contained in:
@@ -277,11 +277,13 @@ first contacts the server, the server sends the client its
|
||||
initial state. Subsequently, clients subscribe to "events," which can
|
||||
(among other things) indicate that settings have changed.
|
||||
|
||||
For the backend piece, we will need our action to make a call to `send_event_on_commit`
|
||||
to send the event to clients that are active. We will also need to
|
||||
modify `fetch_initial_state_data` so that the new field is passed to
|
||||
clients. See [our event system docs](../subsystems/events-system.md) for all the
|
||||
gory details.
|
||||
For the backend piece, we will need our action to make a call to
|
||||
`send_event_on_commit` to send the event to clients that are active
|
||||
(The event is only sent after the current database transaction
|
||||
commits, hence the name). We will also need to modify
|
||||
`fetch_initial_state_data` so that the new field is passed to
|
||||
clients. See [our event system docs](../subsystems/events-system.md)
|
||||
for all the gory details.
|
||||
|
||||
Anyway, getting back to implementation details...
|
||||
|
||||
|
||||
@@ -332,9 +332,9 @@ def update_realm(
|
||||
```
|
||||
|
||||
`realm.save()` actually saves the changes to the realm to the
|
||||
database, and `send_event_on_commit` sends the event to active clients belonging
|
||||
to the provided list of users (in this case, all active users in the
|
||||
Zulip realm).
|
||||
database, and `send_event_on_commit` sends the event to active clients
|
||||
belonging to the provided list of users (in this case, all active
|
||||
users in the Zulip realm), once the current transaction completes.
|
||||
|
||||
### Calling from the web application
|
||||
|
||||
|
||||
Reference in New Issue
Block a user