Skip to content

Commit

Permalink
Merge pull request #549 from nbenaglia/feature/architecture-diagram
Browse files Browse the repository at this point in the history
Documentation: add architecture diagram
  • Loading branch information
mikedilger authored Oct 15, 2023
2 parents 1cd895e + 09a8ab2 commit 5d6a45a
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Developing

![Gossip Architecture](./assets/architecture.png)

Gossip is architected with the following components:

- A User Interface thread, synchronous
- Tokio asynchronous runtime running
- An overlord (handles most jobs)
- A set of minions (each one handles one relay)
- An overlord: handles any operation that involves talking to relays, and a few more
- A set of minions: each one contacts a proper relay to get data, composing the filter and sending it to the relay

## Keeping the UI responsive

Expand Down Expand Up @@ -48,7 +50,7 @@ The flow generally happens like this:

## Pull Requests

I prefer that you run and make pass:
Before issuing a Pull Request, please run and make pass:

````bash
cargo clippy
Expand All @@ -60,6 +62,4 @@ and then
cargo fmt
````

before you issue a pull request. Otherwise I'll have to do it for you.

Also, I don't like branches that have a lot of commits that are messed up, but happen to end up in a good state due to the last commit. If you have a branch like this, create a new branch and one-by-one create a series of commits, each one a single logical step, each one compiling, each one passing clippy and rustfmt, each one documented, and each one doing something useful, such that this series of commits ends up where you originally got to (or somewhere even better). This not only makes it much easier to evaluate the PR, but it makes it possible to revert logical units later on if anything needs to be reverted, without necessarily reverting the entire branch.
Avoid branches that have a lot of commits that are messed up, but happen to end up in a good state due to the last commit. If you have a branch like this, create a new branch and one-by-one create a series of commits, each one a single logical step, each one compiling, each one passing clippy and rustfmt, each one documented, and each one doing something useful, such that this series of commits ends up where you originally got to (or somewhere even better). This not only makes it much easier to evaluate the PR, but it makes it possible to revert logical units later on if anything needs to be reverted, without necessarily reverting the entire branch.
Binary file added docs/assets/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions docs/assets/gossip_architecture.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<mxfile host="app.diagrams.net" modified="2023-10-14T10:22:26.711Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" etag="dnj9X1hDH0qO7vgzD22C" version="22.0.4" type="device">
<diagram name="Page-1" id="TgtwNu3fVf1KPcH3ozeP">
<mxGraphModel dx="1434" dy="714" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="np8rZvkhgI0D0TGchNWL-17" value="amuses with gossip" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" edge="1">
<mxGeometry x="0.1286" y="20" relative="1" as="geometry">
<mxPoint x="61" y="370" as="sourcePoint" />
<mxPoint x="201" y="370" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-1" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
<mxGeometry x="30" y="340" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" target="np8rZvkhgI0D0TGchNWL-3" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="320" y="370" as="sourcePoint" />
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-10" value="send messages" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="np8rZvkhgI0D0TGchNWL-9" vertex="1" connectable="0">
<mxGeometry x="0.1677" y="4" relative="1" as="geometry">
<mxPoint x="-101" y="-16" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-26" value="&lt;div&gt;renders data&lt;/div&gt;" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="np8rZvkhgI0D0TGchNWL-32" target="np8rZvkhgI0D0TGchNWL-8" edge="1">
<mxGeometry x="-0.875" y="50" relative="1" as="geometry">
<mxPoint x="260" y="420" as="sourcePoint" />
<mxPoint x="260" y="640" as="targetPoint" />
<Array as="points">
<mxPoint x="260" y="640" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="np8rZvkhgI0D0TGchNWL-3" target="np8rZvkhgI0D0TGchNWL-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="830" y="460" as="targetPoint" />
<mxPoint x="730" y="370" as="sourcePoint" />
<Array as="points">
<mxPoint x="831" y="370" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-13" value="engages async workers (called minions)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="np8rZvkhgI0D0TGchNWL-12" vertex="1" connectable="0">
<mxGeometry x="-0.4226" y="-5" relative="1" as="geometry">
<mxPoint x="75" y="-25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-3" value="Overload" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
<mxGeometry x="580" y="340" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-7" value="" style="group;" parent="1" vertex="1" connectable="0">
<mxGeometry x="750" y="420" width="160" height="100" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-4" value="" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" parent="np8rZvkhgI0D0TGchNWL-7" vertex="1">
<mxGeometry width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-5" value="" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="np8rZvkhgI0D0TGchNWL-7" vertex="1">
<mxGeometry x="20" y="20" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-6" value="Minions" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="np8rZvkhgI0D0TGchNWL-7" vertex="1">
<mxGeometry x="40" y="40" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-8" value="Globals" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="340" y="610" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-23" value="callback" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.75;entryY=1;entryDx=0;entryDy=0;dashed=1;dashPattern=8 8;" parent="1" source="np8rZvkhgI0D0TGchNWL-4" edge="1">
<mxGeometry x="-0.0909" y="10" relative="1" as="geometry">
<mxPoint x="700" y="400" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-29" value="stores data" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="np8rZvkhgI0D0TGchNWL-27" target="np8rZvkhgI0D0TGchNWL-8" edge="1">
<mxGeometry x="-0.1667" y="-10" relative="1" as="geometry">
<Array as="points">
<mxPoint x="640" y="640" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-27" value="Process.rs" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="580" y="610" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-30" value="Architecture Overview" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=31;" parent="1" vertex="1">
<mxGeometry x="280" y="200" width="510" height="30" as="geometry" />
</mxCell>
<mxCell id="np8rZvkhgI0D0TGchNWL-32" value="GUI" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="200" y="340" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="2C8rZJ-Ew4Z57BIN0wND-1" value="events flow from minions" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="np8rZvkhgI0D0TGchNWL-6" target="np8rZvkhgI0D0TGchNWL-27">
<mxGeometry x="-0.5556" y="90" relative="1" as="geometry">
<Array as="points">
<mxPoint x="850" y="640" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

0 comments on commit 5d6a45a

Please sign in to comment.