Software /
code /
prosody
Annotate
spec/scansion/pubsub_multi_items.scs @ 11661:735b8f4a6d7e
net.http: Send entire HTTP request header as one write
When opportunistic writes are enabled this reduces the number of
syscalls and TCP packets sent on the wire.
Experiments with TCP Fast Open made this even more obvious.
That table trick probably wasn't as efficient. Lua generates bytecode
for a table with zero array slots and space for two entries in the hash
part, plus code to set [2] and [4]. I didn't verify but I suspect it
would have had to resize the table when setting [1] and [3], although
probably only once. Concatenating the strings directly in Lua is easier
to read and involves no extra table or function call.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 08 Jul 2021 18:21:59 +0200 |
parent | 11631:6641ca266d94 |
child | 11714:d783716103c1 |
rev | line source |
---|---|
9833 | 1 # Pubsub: Requesting multiple specific items from a node (#1322) |
2 | |
3 [Client] Alice | |
4 jid: admin@localhost | |
5 password: password | |
6 | |
7 --------- | |
8 | |
9 Alice connects | |
10 | |
11 Alice sends: | |
12 <presence xmlns:stream="http://etherx.jabber.org/streams" id=":7IoqYcT3191rfk_dZGo2"/> | |
13 | |
14 Alice receives: | |
15 <presence xmlns:stream="http://etherx.jabber.org/streams" from="${Alice's full JID}" id=":7IoqYcT3191rfk_dZGo2"/> | |
16 | |
17 Alice sends: | |
18 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":m0SM8Hn5JxP9BJJ_X4Mz" type="set"> | |
19 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
20 <create node="e96caf12-264f-4e5a-988e-00ae191771b6"/> | |
21 </pubsub> | |
22 </iq> | |
23 | |
24 Alice receives: | |
25 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":m0SM8Hn5JxP9BJJ_X4Mz"/> | |
26 | |
27 Alice sends: | |
28 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":gwZgEQmzAHcQz-FZOxi-" type="get"> | |
29 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
30 <configure node="e96caf12-264f-4e5a-988e-00ae191771b6"/> | |
31 </pubsub> | |
32 </iq> | |
33 | |
34 Alice receives: | |
35 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":gwZgEQmzAHcQz-FZOxi-"> | |
36 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
37 <configure node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
38 <x xmlns="jabber:x:data" type="form"> | |
39 <field var="FORM_TYPE" type="hidden"> | |
40 <value>http://jabber.org/protocol/pubsub#node_config</value> | |
41 </field> | |
42 <field var="pubsub#title" label="Title" type="text-single"/> | |
43 <field var="pubsub#description" label="Description" type="text-single"/> | |
44 <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> | |
45 <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> | |
11631
6641ca266d94
mod_pubsub,mod_pep: Support "max" as 'pubsub#max_items'
Kim Alvefur <zash@zash.se>
parents:
9833
diff
changeset
|
46 <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"/> |
9833 | 47 <value>20</value> |
48 </field> | |
49 <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> | |
50 <value>0</value> | |
51 </field> | |
52 <field var="pubsub#access_model" label="Specify the subscriber model" type="list-single"> | |
53 <option label="authorize"> | |
54 <value>authorize</value> | |
55 </option> | |
56 <option label="open"> | |
57 <value>open</value> | |
58 </option> | |
59 <option label="presence"> | |
60 <value>presence</value> | |
61 </option> | |
62 <option label="roster"> | |
63 <value>roster</value> | |
64 </option> | |
65 <option label="whitelist"> | |
66 <value>whitelist</value> | |
67 </option> | |
68 <value>open</value> | |
69 </field> | |
70 <field var="pubsub#publish_model" label="Specify the publisher model" type="list-single"> | |
71 <option label="publishers"> | |
72 <value>publishers</value> | |
73 </option> | |
74 <option label="subscribers"> | |
75 <value>subscribers</value> | |
76 </option> | |
77 <option label="open"> | |
78 <value>open</value> | |
79 </option> | |
80 <value>publishers</value> | |
81 </field> | |
82 <field var="pubsub#deliver_notifications" label="Whether to deliver event notifications" type="boolean"> | |
83 <value>1</value> | |
84 </field> | |
85 <field var="pubsub#deliver_payloads" label="Whether to deliver payloads with event notifications" type="boolean"> | |
86 <value>1</value> | |
87 </field> | |
88 <field var="pubsub#notification_type" label="Specify the delivery style for notifications" type="list-single"> | |
89 <option label="Messages of type normal"> | |
90 <value>normal</value> | |
91 </option> | |
92 <option label="Messages of type headline"> | |
93 <value>headline</value> | |
94 </option> | |
95 <value>headline</value> | |
96 </field> | |
97 <field var="pubsub#notify_delete" label="Whether to notify subscribers when the node is deleted" type="boolean"> | |
98 <value>1</value> | |
99 </field> | |
100 <field var="pubsub#notify_retract" label="Whether to notify subscribers when items are removed from the node" type="boolean"> | |
101 <value>1</value> | |
102 </field> | |
103 </x> | |
104 </configure> | |
105 </pubsub> | |
106 </iq> | |
107 | |
108 Alice sends: | |
109 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":pfWBQ2MNIq8ieul57Qp7" type="set"> | |
110 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
111 <publish node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
112 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"> | |
113 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> | |
114 </item> | |
115 </publish> | |
116 </pubsub> | |
117 </iq> | |
118 | |
119 Alice receives: | |
120 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":pfWBQ2MNIq8ieul57Qp7"> | |
121 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
122 <publish node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
123 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"/> | |
124 </publish> | |
125 </pubsub> | |
126 </iq> | |
127 | |
128 Alice sends: | |
129 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":Q5TLT6nsW0HHdkDgrPPe" type="set"> | |
130 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
131 <publish node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
132 <item id="4b94623d-1127-41c0-ac47-e283fd890557"> | |
133 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> | |
134 </item> | |
135 </publish> | |
136 </pubsub> | |
137 </iq> | |
138 | |
139 Alice receives: | |
140 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":Q5TLT6nsW0HHdkDgrPPe"> | |
141 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
142 <publish node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
143 <item id="4b94623d-1127-41c0-ac47-e283fd890557"/> | |
144 </publish> | |
145 </pubsub> | |
146 </iq> | |
147 | |
148 Alice sends: | |
149 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":3nvB2E20p1iuM6lOPaP6" type="get"> | |
150 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
151 <items node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
152 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"/> | |
153 <item id="4b94623d-1127-41c0-ac47-e283fd890557"/> | |
154 </items> | |
155 </pubsub> | |
156 </iq> | |
157 | |
158 Alice receives: | |
159 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":3nvB2E20p1iuM6lOPaP6"> | |
160 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
161 <items node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
162 <item xmlns="http://jabber.org/protocol/pubsub" id="20e9eb9e-8acb-436e-a486-40e80400faf1"> | |
163 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> | |
164 </item> | |
165 <item xmlns="http://jabber.org/protocol/pubsub" id="4b94623d-1127-41c0-ac47-e283fd890557"> | |
166 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> | |
167 </item> | |
168 </items> | |
169 </pubsub> | |
170 </iq> | |
171 | |
172 Alice sends: | |
173 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":XQdyK54iyOKiJvUoX9t_" type="get"> | |
174 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
175 <items node="e96caf12-264f-4e5a-988e-00ae191771b6"/> | |
176 </pubsub> | |
177 </iq> | |
178 | |
179 Alice receives: | |
180 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":XQdyK54iyOKiJvUoX9t_"> | |
181 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
182 <items node="e96caf12-264f-4e5a-988e-00ae191771b6"> | |
183 <item xmlns="http://jabber.org/protocol/pubsub" id="20e9eb9e-8acb-436e-a486-40e80400faf1"> | |
184 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> | |
185 </item> | |
186 <item xmlns="http://jabber.org/protocol/pubsub" id="4b94623d-1127-41c0-ac47-e283fd890557"> | |
187 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> | |
188 </item> | |
189 </items> | |
190 </pubsub> | |
191 </iq> | |
192 | |
193 Alice sends: | |
194 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":ySGQOz5tnyWT82idwJZP" type="set"> | |
195 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
196 <delete node="e96caf12-264f-4e5a-988e-00ae191771b6"/> | |
197 </pubsub> | |
198 </iq> | |
199 | |
200 Alice receives: | |
201 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":ySGQOz5tnyWT82idwJZP"/> | |
202 |