agora.observe.sync_service
Matrix sync-loop driver.
Wraps MatrixClientProtocol.sync_once() in an infinite loop, feeding each
batch into an EventDispatcher. Cancellation-safe via stop().
Usage:
service = SyncService(client, dispatcher, rooms=[project_room])
await service.start() # fire-and-forget background task
...
await service.stop() # cancels cleanly
Or drive it synchronously in foreground:
await service.run()
Classes
Owns the Matrix sync loop: repeatedly calls |
- class agora.observe.sync_service.SyncService[source]
Bases:
objectOwns the Matrix sync loop: repeatedly calls
sync_onceand feeds each batch to theEventDispatcher.start()runs it as a background task,run()in the foreground;stop()cancels cleanly (the loop is cancellation-safe, so an in-flight sync won’t leak).