rintrix/matrix/timers.py

10 lines
455 B
Python

from chatlib import addtimer
# This function just dumps /sync blobs in the event queue as a raw event.
# ALL handling is deferred to handlers.
# ... Except updating the since token. That's important to do here to guarantee that it never calls with the same token twice.
@addtimer(0)
async def sync(self):
blob=await self.request(params={'timeout':30000,'since':self.since})
self.since=blob['next_batch']
self.event_queue.put(Event('m.sync',None,blob))