From 306ba25c38f864280c9f78a06816d713f1113416 Mon Sep 17 00:00:00 2001
From: erikjohnston Note how the commit comment explains clearly what is changing and why. Also
note the absence of merge commits, as well as the absence of commits called
things like (to pick a few culprits):
-“pep8”, “fix broken
+“pep8”, “fix broken
test”,
-“oops”,
-“typo”, or “Who's
+“oops”,
+“typo”, or “Who's
the president?”. There are a number of reasons why keeping a clean commit history is a good
thing: Synapse has a concept of "streams", which are roughly described in Synapse has a concept of "streams", which are roughly described in git log --grap
Streams
-id_generators.py
.
+id_generators.py
.
Generally speaking, streams are a series of notifications that something in Synapse's database has changed that the application might need to respond to.
For example:
@@ -168,9 +168,9 @@ For example:
See synapse.replication.tcp.streams
for the full list of streams.
See synapse.replication.tcp.streams
for the full list of streams.
It is very helpful to understand the streams mechanism when working on any part of Synapse that needs to respond to changes—especially if those changes are made by different workers.
-To that end, let's describe streams formally, paraphrasing from the docstring of AbstractStreamIdGenerator
.
AbstractStreamIdGenerator
.
A stream is an append-only log T1, T2, ..., Tn, ...
of facts1 which grows over time.
Only "writers" can add facts to a stream, and there may be multiple writers.