-
Notifications
You must be signed in to change notification settings - Fork 0
/
zgossip.xml
57 lines (51 loc) · 1.83 KB
/
zgossip.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<class
name = "zgossip"
title = "zgossip server"
script = "zproto_server_go"
protocol_class = "zgossip_msg"
protocol_package = "github.com/armen/goviral/zgossip/msg"
package_dir = "."
>
Package zgossip is a server implementation of the ZeroMQ Gossip Discovery Protocol
<include filename = "license.xml" />
<state name = "start" inherit = "external">
<!-- Peer says HELLO and we send it all known tuples -->
<event name = "HELLO" next = "have tuple">
<action name = "get first tuple" />
</event>
</state>
<state name = "have tuple">
<event name = "ok">
<action name = "send" message = "PUBLISH" />
<action name = "get next tuple" />
</event>
<event name = "finished" next = "connected" />
</state>
<state name = "connected" inherit = "external">
<!-- Peer publishes a new tuple -->
<event name = "PUBLISH">
<action name = "store tuple if new" />
</event>
<!-- Forward a new tuple to this client -->
<event name = "forward">
<action name = "get tuple to forward" />
<action name = "send" message = "PUBLISH" />
</event>
</state>
<!-- Superstate for external states -->
<state name = "external">
<!-- Peer signals it's alive -->
<event name = "PING">
<action name = "send" message = "PONG" />
</event>
<!-- All other protocol messages are invalid -->
<event name = "*">
<action name = "send" message = "INVALID" />
<action name = "terminate" />
</event>
<!-- This built-in event hits on a client timeout -->
<event name = "expired">
<action name = "terminate" />
</event>
</state>
</class>