__init__.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 Vector Creations Ltd
  3. # Copyright 2019 New Vector Ltd
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. """Defines all the valid streams that clients can subscribe to, and the format
  17. of the rows returned by each stream.
  18. Each stream is defined by the following information:
  19. stream name: The name of the stream
  20. row type: The type that is used to serialise/deserialse the row
  21. current_token: The function that returns the current token for the stream
  22. update_function: The function that returns a list of updates between two tokens
  23. """
  24. from . import _base, events, federation
  25. STREAMS_MAP = {
  26. stream.NAME: stream
  27. for stream in (
  28. events.EventsStream,
  29. _base.BackfillStream,
  30. _base.PresenceStream,
  31. _base.TypingStream,
  32. _base.ReceiptsStream,
  33. _base.PushRulesStream,
  34. _base.PushersStream,
  35. _base.CachesStream,
  36. _base.PublicRoomsStream,
  37. _base.DeviceListsStream,
  38. _base.ToDeviceStream,
  39. federation.FederationStream,
  40. _base.TagAccountDataStream,
  41. _base.AccountDataStream,
  42. _base.GroupServerStream,
  43. _base.UserSignatureStream,
  44. )
  45. }