-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path.preload
More file actions
31 lines (26 loc) · 796 Bytes
/
.preload
File metadata and controls
31 lines (26 loc) · 796 Bytes
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
local fmt=string.format
print"-------------- CREATING BROKER -----------------"
-- The following two are used by smq.lsp
app.smq = require"smq.hub"
app.broker = smq.create()
local broker=app.broker
local topics = { -- Array starting at 1
"", -- #1 is reserved by broker; it is the etid of the broker's SMQ client.
"EXAMPLE_STRUCT_A",
"EXAMPLE_STRUCT_B",
"EXAMPLE_JSTRUCT_A",
"EXAMPLE_JSON_ARRAY"
}
for tid,topic in ipairs(topics) do
if tid ~= 1 then
print(fmt("Registering topic %-20s with tid %d",topic,tid))
assert(broker:create(topic,tid) == tid)
end
end
print("\nFor your C program:")
for tid,topic in ipairs(topics) do
if tid ~= 1 then
print(fmt("#define %-20s %d",topic,tid))
end
end
print"------------------------------------------------"