2019-03-27 05:58:42 -04:00
|
|
|
#
|
2023-11-21 15:29:58 -05:00
|
|
|
# This file is licensed under the Affero General Public License (AGPL) version 3.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2023 New Vector, Ltd
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# See the GNU Affero General Public License for more details:
|
|
|
|
# <https://www.gnu.org/licenses/agpl-3.0.html>.
|
|
|
|
#
|
|
|
|
# Originally licensed under the Apache License, Version 2.0:
|
|
|
|
# <http://www.apache.org/licenses/LICENSE-2.0>.
|
|
|
|
#
|
|
|
|
# [This file includes modifications made by New Vector Limited]
|
2019-03-27 05:58:42 -04:00
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
"""Defines all the valid streams that clients can subscribe to, and the format
|
|
|
|
of the rows returned by each stream.
|
|
|
|
|
|
|
|
Each stream is defined by the following information:
|
|
|
|
|
|
|
|
stream name: The name of the stream
|
|
|
|
row type: The type that is used to serialise/deserialse the row
|
|
|
|
current_token: The function that returns the current token for the stream
|
|
|
|
update_function: The function that returns a list of updates between two tokens
|
|
|
|
"""
|
2020-03-25 10:54:01 -04:00
|
|
|
|
2020-03-23 07:39:36 -04:00
|
|
|
from synapse.replication.tcp.streams._base import (
|
|
|
|
AccountDataStream,
|
|
|
|
BackfillStream,
|
|
|
|
CachesStream,
|
|
|
|
DeviceListsStream,
|
2021-04-20 09:11:24 -04:00
|
|
|
PresenceFederationStream,
|
2020-03-23 07:39:36 -04:00
|
|
|
PresenceStream,
|
|
|
|
PushersStream,
|
|
|
|
PushRulesStream,
|
|
|
|
ReceiptsStream,
|
2020-03-25 10:54:01 -04:00
|
|
|
Stream,
|
2020-03-23 07:39:36 -04:00
|
|
|
ToDeviceStream,
|
|
|
|
TypingStream,
|
|
|
|
)
|
|
|
|
from synapse.replication.tcp.streams.events import EventsStream
|
|
|
|
from synapse.replication.tcp.streams.federation import FederationStream
|
2022-12-14 09:47:11 -05:00
|
|
|
from synapse.replication.tcp.streams.partial_state import (
|
|
|
|
UnPartialStatedEventStream,
|
|
|
|
UnPartialStatedRoomStream,
|
|
|
|
)
|
2019-03-27 05:58:42 -04:00
|
|
|
|
|
|
|
STREAMS_MAP = {
|
|
|
|
stream.NAME: stream
|
|
|
|
for stream in (
|
2020-03-23 07:39:36 -04:00
|
|
|
EventsStream,
|
|
|
|
BackfillStream,
|
|
|
|
PresenceStream,
|
2021-04-20 09:11:24 -04:00
|
|
|
PresenceFederationStream,
|
2020-03-23 07:39:36 -04:00
|
|
|
TypingStream,
|
|
|
|
ReceiptsStream,
|
|
|
|
PushRulesStream,
|
|
|
|
PushersStream,
|
|
|
|
CachesStream,
|
|
|
|
DeviceListsStream,
|
|
|
|
ToDeviceStream,
|
|
|
|
FederationStream,
|
|
|
|
AccountDataStream,
|
2022-12-05 08:07:55 -05:00
|
|
|
UnPartialStatedRoomStream,
|
2022-12-14 09:47:11 -05:00
|
|
|
UnPartialStatedEventStream,
|
2019-03-27 05:58:42 -04:00
|
|
|
)
|
2020-04-17 09:49:55 -04:00
|
|
|
}
|
2020-03-23 07:39:36 -04:00
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"STREAMS_MAP",
|
2020-03-25 10:54:01 -04:00
|
|
|
"Stream",
|
2020-03-23 07:39:36 -04:00
|
|
|
"BackfillStream",
|
|
|
|
"PresenceStream",
|
2021-04-20 09:11:24 -04:00
|
|
|
"PresenceFederationStream",
|
2020-03-23 07:39:36 -04:00
|
|
|
"TypingStream",
|
|
|
|
"ReceiptsStream",
|
|
|
|
"PushRulesStream",
|
|
|
|
"PushersStream",
|
|
|
|
"CachesStream",
|
|
|
|
"DeviceListsStream",
|
|
|
|
"ToDeviceStream",
|
|
|
|
"AccountDataStream",
|
2022-12-05 08:07:55 -05:00
|
|
|
"UnPartialStatedRoomStream",
|
2022-12-14 09:47:11 -05:00
|
|
|
"UnPartialStatedEventStream",
|
2020-03-23 07:39:36 -04:00
|
|
|
]
|