Use stream_change cache to make get_forward_extremeties_for_room cache more effective

This commit is contained in:
Erik Johnston 2016-09-15 14:27:15 +01:00
parent 55e6fc917c
commit cb3edec6af
3 changed files with 19 additions and 2 deletions

View file

@ -121,3 +121,8 @@ class StreamChangeCache(object):
k, r = self._cache.popitem()
self._earliest_known_stream_pos = max(k, self._earliest_known_stream_pos)
self._entity_to_key.pop(r, None)
def get_pos_of_last_change(self, entity):
"""Returns the stream pos of the last change for an entitiy, if known.
"""
return self._entity_to_key.get(entity, None)