docs: Tweak some documentation around send_event.

This commit is contained in:
Tim Abbott
2024-09-20 15:28:18 -07:00
parent a7f48e260c
commit 51d0dfb504
4 changed files with 27 additions and 13 deletions

View File

@@ -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...

View File

@@ -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