'Returns the current token for rooms stream.
By default, it returns the current global stream token. Specifying a
`room_id` causes it to return the current room specific topological
token.'

@defer.inlineCallbacks
def get_room_events_max_id(self, room_id=None):

    token = (yield self._stream_id_gen.get_current_token())
    if (room_id is None):
        defer.returnValue(('s%d' % (token,)))
    else:
        topo = (yield self.runInteraction('_get_max_topological_txn', self._get_max_topological_txn, room_id))
        defer.returnValue(('t%d-%d' % (topo, token)))
