diff options
author | Travis Ralston <travpc@gmail.com> | 2018-10-12 16:24:07 -0600 |
---|---|---|
committer | Travis Ralston <travpc@gmail.com> | 2018-10-12 16:24:07 -0600 |
commit | 7ede6509561ebe4c217210ea3431421fcf9910b2 (patch) | |
tree | 146a92462af13f48ca90f5096394d34b573eb393 /synapse/storage/stream.py | |
parent | Changelog (diff) | |
parent | Make workers work on Py3 (#4027) (diff) | |
download | synapse-7ede6509561ebe4c217210ea3431421fcf9910b2.tar.xz |
Merge branch 'develop' into travis/login-terms
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r-- | synapse/storage/stream.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index 4c296d72c0..d6cfdba519 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -630,7 +630,21 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): @defer.inlineCallbacks def get_all_new_events_stream(self, from_id, current_id, limit): - """Get all new events""" + """Get all new events + + Returns all events with from_id < stream_ordering <= current_id. + + Args: + from_id (int): the stream_ordering of the last event we processed + current_id (int): the stream_ordering of the most recently processed event + limit (int): the maximum number of events to return + + Returns: + Deferred[Tuple[int, list[FrozenEvent]]]: A tuple of (next_id, events), where + `next_id` is the next value to pass as `from_id` (it will either be the + stream_ordering of the last returned event, or, if fewer than `limit` events + were found, `current_id`. + """ def get_all_new_events_stream_txn(txn): sql = ( |