This makes the serialization of events synchronous (and it no longer access the database), but we must manually calculate and provide the bundled aggregations. Overall this should cause no change in behavior, but is prep work for other improvements.
synapse.appservice
unsigned
synapse.metrics
get_json
ModuleApi.looping_background_call
get_current_events_token
synapse/