Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Synapse Architecture
  2. As of the end of Oct 2014, Synapse's overall architecture looks like:
  3. synapse
  4. .-----------------------------------------------------.
  5. | Notifier |
  6. | ^ | |
  7. | | | |
  8. | .------------|------. |
  9. | | handlers/ | | |
  10. | | v | |
  11. | | Event*Handler <--------> rest/* <=> Client
  12. | | Rooms*Handler | |
  13. HS <=> federation/* <==> FederationHandler | |
  14. | | | PresenceHandler | |
  15. | | | TypingHandler | |
  16. | | '-------------------' |
  17. | | | | |
  18. | | state/* | |
  19. | | | | |
  20. | | v v |
  21. | `--------------> storage/* |
  22. | | |
  23. '--------------------------|--------------------------'
  24. v
  25. .----.
  26. | DB |
  27. '----'
  28. - Handlers: business logic of synapse itself. Follows a set contract of BaseHandler:
  29. - BaseHandler gives us onNewRoomEvent which: (TODO: flesh this out and make it less cryptic):
  30. - handle_state(event)
  31. - auth(event)
  32. - persist_event(event)
  33. - notify notifier or federation(event)
  34. - PresenceHandler: use distributor to get EDUs out of Federation.
  35. Very lightweight logic built on the distributor
  36. - TypingHandler: use distributor to get EDUs out of Federation.
  37. Very lightweight logic built on the distributor
  38. - EventsHandler: handles the events stream...
  39. - FederationHandler: - gets PDU from Federation Layer; turns into
  40. an event; follows basehandler functionality.
  41. - RoomsHandler: does all the room logic, including members - lots
  42. of classes in RoomsHandler.
  43. - ProfileHandler: talks to the storage to store/retrieve profile
  44. info.
  45. - EventFactory: generates events of particular event types.
  46. - Notifier: Backs the events handler
  47. - REST: Interfaces handlers and events to the outside world via
  48. HTTP/JSON. Converts events back and forth from JSON.
  49. - Federation: holds the HTTP client & server to talk to other servers.
  50. Does replication to make sure there's nothing missing in the graph.
  51. Handles reliability. Handles txns.
  52. - Distributor: generic event bus. used for presence & typing only
  53. currently. Notifier could be implemented using Distributor - so far
  54. we are only using for things which actually /require/ dynamic
  55. pluggability however as it can obfuscate the actual flow of control.
  56. - Auth: helper singleton to say whether a given event is allowed to do
  57. a given thing (TODO: put this on the diagram)
  58. - State: helper singleton: does state conflict resolution. You give it
  59. an event and it tells you if it actually updates the state or not,
  60. and annotates the event up properly and handles merge conflict
  61. resolution.
  62. - Storage: abstracts the storage engine.