Skip to content

Commit 4c14866

Browse files
committed
Add pluggable discovery states documentation
1 parent 2d0d6b3 commit 4c14866

3 files changed

+32
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
digraph {
2+
// This generates pluggable-discovery-state-machine.png
3+
// using the following command:
4+
// dot -Tpng -Gsize=10,20\! pluggable-discovery-state-machine.dot > pluggable-discovery-state-machine.png
5+
label="Pluggable discovery state machine"
6+
labelloc=t
7+
fontname="sans-serif"
8+
node [fontname="sans-serif"]
9+
edge [colorscheme=set15 fontsize=7 fontname="sans-serif"]
10+
Alive -> Idling [label=" HELLO " color=2 fontcolor=2]
11+
Idling -> Running [label=" START " color=3 fontcolor=3]
12+
Running -> Idling [label=" STOP " color=1 fontcolor=1]
13+
Running -> Running [label=" LIST " color=5 fontcolor=5]
14+
Running -> Dead [label=" QUIT " color=4 fontcolor=4]
15+
Idling -> Syncing [label=" START_SYNC " color=3 fontcolor=3]
16+
Syncing -> Idling [label=" STOP " color=1 fontcolor=1]
17+
Syncing -> Dead [label=" QUIT " color=4 fontcolor=4]
18+
Idling -> Dead [label=" QUIT " color=4 fontcolor=4]
19+
Alive -> Dead [label=" QUIT " color=4 fontcolor=4]
20+
}
99.5 KB
Loading

docs/pluggable-discovery-specification.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,18 @@ If the client sends an invalid or malformed command, the discovery should answer
276276
}
277277
```
278278

279+
### State machine
280+
281+
A well behaved pluggable discovery tool must reflect the following state machine.
282+
283+
![Pluggable discovery state machine](img/pluggable-discovery-state-machine.png)
284+
285+
The arrows represent the commands outlined in the above sections, calling successfully a command assumes the state
286+
changes.
287+
288+
A pluggable discovery state is Alive when the process has been started but no command has been executed. Dead means the
289+
process has been stopped and no further commands can be received.
290+
279291
### Board identification
280292

281293
The `properties` associated to a port can be used to identify the board attached to that port. The algorithm is simple:

0 commit comments

Comments
 (0)