-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstream.proto
49 lines (39 loc) · 1.45 KB
/
stream.proto
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
syntax = "proto3";
import "common.proto";
package telegraph.stream;
message Subscribe {
uint32 var_id = 1; // actually 16 bits
uint32 debounce = 2; // in ms
uint32 refresh = 3; // in ms
uint32 sub_timeout = 4; // actually 16 bits
}
message Call {
uint32 action_id = 1; // actually 16 bits
uint32 call_timeout = 2; // actually 16 bits
Value arg = 3;
}
message Cancel {
uint32 var_id = 1; // actually 16 bits
uint32 cancel_timeout = 2; // actually 16 bits
}
message Packet {
uint32 req_id = 1; // set to var_id for updates
oneof event {
uint32 fetch_node = 2;
Node node = 3; // has placeholders instead of the whole tree
Value update = 4; // SPECIAL: uses req_id for the variable id to save space
Call call_action = 5;
Value call_completed = 6;
Empty call_failed = 7;
Subscribe change_sub = 8;
Cancel cancel_sub = 9;
Empty poll_sub = 10; // triggers a re-publish over the latest value on the end node
// and will reset the timers associated with this subscription
// along the whole path, ensuring a subsequent update
// (i.e due to a poll or otherwise) will arrive
bool success = 11;
uint32 cancelled = 12;
int32 ping = 13; // contains number of subscriptions active (ping!)
int32 pong = 14; // contains number of subscriptions active
}
}