forked from asciipip/TopOSM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MESSAGE_PROTOCOL
70 lines (45 loc) · 1.74 KB
/
MESSAGE_PROTOCOL
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
58
59
60
61
62
63
64
65
66
67
68
69
70
Messages are all JSON.
Command:
{ "command": <command-name>, <parameters> ... }
Normal rendering sequence:
queuemaster -> all renderers
{ "command": "queuemaster online" }
renderer -> queuemaster
{ "command": "register",
"hostname": <hostname>,
"pid": <pid>,
"threadid: <threadid>,
"strategy": <strategy> }
"strategy" one of:
* missing - Only render tiles that have been requested because they've
never been rendered.
* important - Only render tiles that have been queued as "important".
Also render missing tiles.
* by_work_available - Distributes work based on current queue length at
various zoom levels. This is the preferred "workhorse" strategy; it
spends rendering effort where it's most needed.
* by_zoom - Distributes work based on total number of tiles at each zoom
level. This is a good strategy for high-zoom cleanup. Once a zoom
level gets down to only a few tiles needing rendering, the
"by_work_available" strategy will basically abandon them in favor of
zoom levels with greater numbers of outstanding tiles. The "by_zoom"
strategy will always favor higher zoom levels because they have more
tiles.
queuemaster -> renderer
{ "command": "render",
"metatile": <metatile e.g. "15/950/1235"> }
renderer -> queuemaster
{ "command": "rendered",
"metatile": <metatile> }
renderer -> queuemaster
{ "command": "unregister" }
All renderer -> queuemaster communication should have the renderer's queue
as the "reply_to" property.
Normal render request sequence:
requester -> queuemaster
{ "command": "render",
"tile": "z/x/y" }
queuemaster -> requester
{ "command": "rendered" }
The queuemaster also understands:
{ "command": "stats" }