summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-08 11:44:20 +0000
committerErik Johnston <erik@matrix.org>2019-03-08 11:44:20 +0000
commit8c4896668fd602e2822dfc48e992ed48bbc5adf7 (patch)
tree99c0052e1697e74379050ad7af4cef2d62f21c2e /synapse/storage/stream.py
parentFactor out soft fail checks (diff)
parentMerge pull request #4829 from matrix-org/erikj/device_list_seen_updates (diff)
downloadsynapse-8c4896668fd602e2822dfc48e992ed48bbc5adf7.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/soft_fail_impl
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index d6cfdba519..580fafeb3a 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -191,6 +191,25 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
     @defer.inlineCallbacks
     def get_room_events_stream_for_rooms(self, room_ids, from_key, to_key, limit=0,
                                          order='DESC'):
+        """Get new room events in stream ordering since `from_key`.
+
+        Args:
+            room_id (str)
+            from_key (str): Token from which no events are returned before
+            to_key (str): Token from which no events are returned after. (This
+                is typically the current stream token)
+            limit (int): Maximum number of events to return
+            order (str): Either "DESC" or "ASC". Determines which events are
+                returned when the result is limited. If "DESC" then the most
+                recent `limit` events are returned, otherwise returns the
+                oldest `limit` events.
+
+        Returns:
+            Deferred[dict[str,tuple[list[FrozenEvent], str]]]
+                A map from room id to a tuple containing:
+                    - list of recent events in the room
+                    - stream ordering key for the start of the chunk of events returned.
+        """
         from_id = RoomStreamToken.parse_stream_token(from_key).stream
 
         room_ids = yield self._events_stream_cache.get_entities_changed(