cojson-transport-ws 0.8.12 → 0.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +160 -147
- package/dist/BatchedOutgoingMessages.js +3 -3
- package/dist/BatchedOutgoingMessages.js.map +1 -1
- package/dist/index.js +87 -40
- package/dist/index.js.map +1 -1
- package/dist/serialization.js +6 -0
- package/dist/serialization.js.map +1 -1
- package/dist/tests/BatchedOutgoingMessages.test.js +41 -11
- package/dist/tests/BatchedOutgoingMessages.test.js.map +1 -1
- package/dist/tests/createWebSocketPeer.test.js +12 -13
- package/dist/tests/createWebSocketPeer.test.js.map +1 -1
- package/package.json +5 -9
- package/src/BatchedOutgoingMessages.ts +36 -35
- package/src/index.ts +182 -122
- package/src/serialization.ts +26 -17
- package/src/tests/BatchedOutgoingMessages.test.ts +138 -106
- package/src/tests/createWebSocketPeer.test.ts +404 -408
- package/src/types.ts +19 -20
- package/tsconfig.json +2 -2
- package/.eslintrc.cjs +0 -24
- package/.prettierrc.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,431 +1,444 @@
|
|
|
1
1
|
# cojson-transport-nodejs-ws
|
|
2
2
|
|
|
3
|
+
## 0.8.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b934fab]
|
|
8
|
+
- cojson@0.8.16
|
|
9
|
+
|
|
10
|
+
## 0.8.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- e0dd006: Add the onClose handler and improve the closing operation
|
|
15
|
+
|
|
3
16
|
## 0.8.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
6
19
|
|
|
7
|
-
-
|
|
8
|
-
|
|
20
|
+
- Updated dependencies [6ed75eb]
|
|
21
|
+
- cojson@0.8.12
|
|
9
22
|
|
|
10
23
|
## 0.8.11
|
|
11
24
|
|
|
12
25
|
### Patch Changes
|
|
13
26
|
|
|
14
|
-
-
|
|
15
|
-
|
|
27
|
+
- Updated dependencies [1ed4ab5]
|
|
28
|
+
- cojson@0.8.11
|
|
16
29
|
|
|
17
30
|
## 0.8.7
|
|
18
31
|
|
|
19
32
|
### Patch Changes
|
|
20
33
|
|
|
21
|
-
-
|
|
34
|
+
- e82cf3d: Enable WebSocket batching on client peers
|
|
22
35
|
|
|
23
36
|
## 0.8.6
|
|
24
37
|
|
|
25
38
|
### Patch Changes
|
|
26
39
|
|
|
27
|
-
-
|
|
40
|
+
- 5542fdb: Added batching to the WebSocket messsages
|
|
28
41
|
|
|
29
42
|
## 0.8.5
|
|
30
43
|
|
|
31
44
|
### Patch Changes
|
|
32
45
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
46
|
+
- Updated dependencies [c3f4e6b]
|
|
47
|
+
- Updated dependencies [d9152ed]
|
|
48
|
+
- cojson@0.8.5
|
|
36
49
|
|
|
37
50
|
## 0.8.3
|
|
38
51
|
|
|
39
52
|
### Patch Changes
|
|
40
53
|
|
|
41
|
-
-
|
|
42
|
-
|
|
54
|
+
- Updated dependencies
|
|
55
|
+
- cojson@0.8.3
|
|
43
56
|
|
|
44
57
|
## 0.8.0
|
|
45
58
|
|
|
46
59
|
### Patch Changes
|
|
47
60
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
61
|
+
- Updated dependencies [6a147c2]
|
|
62
|
+
- Updated dependencies [ad40b88]
|
|
63
|
+
- cojson@0.8.0
|
|
51
64
|
|
|
52
65
|
## 0.7.35
|
|
53
66
|
|
|
54
67
|
### Patch Changes
|
|
55
68
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
69
|
+
- f350e90: Added a priority system for the sync messages
|
|
70
|
+
- Updated dependencies [35bbcd9]
|
|
71
|
+
- Updated dependencies [f350e90]
|
|
72
|
+
- cojson@0.7.35
|
|
60
73
|
|
|
61
74
|
## 0.7.34
|
|
62
75
|
|
|
63
76
|
### Patch Changes
|
|
64
77
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
|
|
78
|
+
- 406ab9b: Remove WS buffer filling log message
|
|
79
|
+
- Updated dependencies [5d91f9f]
|
|
80
|
+
- Updated dependencies [5094e6d]
|
|
81
|
+
- Updated dependencies [b09589b]
|
|
82
|
+
- Updated dependencies [2c3a40c]
|
|
83
|
+
- Updated dependencies [4e16575]
|
|
84
|
+
- Updated dependencies [ea882ab]
|
|
85
|
+
- cojson@0.7.34
|
|
73
86
|
|
|
74
87
|
## 0.7.34-neverthrow.8
|
|
75
88
|
|
|
76
89
|
### Patch Changes
|
|
77
90
|
|
|
78
|
-
-
|
|
79
|
-
|
|
91
|
+
- Updated dependencies
|
|
92
|
+
- cojson@0.7.34-neverthrow.8
|
|
80
93
|
|
|
81
94
|
## 0.7.34-neverthrow.7
|
|
82
95
|
|
|
83
96
|
### Patch Changes
|
|
84
97
|
|
|
85
|
-
-
|
|
86
|
-
|
|
98
|
+
- Updated dependencies
|
|
99
|
+
- cojson@0.7.34-neverthrow.7
|
|
87
100
|
|
|
88
101
|
## 0.7.34-neverthrow.4
|
|
89
102
|
|
|
90
103
|
### Patch Changes
|
|
91
104
|
|
|
92
|
-
-
|
|
93
|
-
|
|
105
|
+
- Updated dependencies
|
|
106
|
+
- cojson@0.7.34-neverthrow.4
|
|
94
107
|
|
|
95
108
|
## 0.7.34-neverthrow.3
|
|
96
109
|
|
|
97
110
|
### Patch Changes
|
|
98
111
|
|
|
99
|
-
-
|
|
100
|
-
|
|
112
|
+
- Updated dependencies
|
|
113
|
+
- cojson@0.7.34-neverthrow.3
|
|
101
114
|
|
|
102
115
|
## 0.7.34-neverthrow.2
|
|
103
116
|
|
|
104
117
|
### Patch Changes
|
|
105
118
|
|
|
106
|
-
-
|
|
119
|
+
- Remove WS buffer filling log message
|
|
107
120
|
|
|
108
121
|
## 0.7.34-neverthrow.1
|
|
109
122
|
|
|
110
123
|
### Patch Changes
|
|
111
124
|
|
|
112
|
-
-
|
|
113
|
-
|
|
125
|
+
- Updated dependencies
|
|
126
|
+
- cojson@0.7.34-neverthrow.1
|
|
114
127
|
|
|
115
128
|
## 0.7.34-neverthrow.0
|
|
116
129
|
|
|
117
130
|
### Patch Changes
|
|
118
131
|
|
|
119
|
-
-
|
|
120
|
-
|
|
132
|
+
- Updated dependencies
|
|
133
|
+
- cojson@0.7.34-neverthrow.0
|
|
121
134
|
|
|
122
135
|
## 0.7.33
|
|
123
136
|
|
|
124
137
|
### Patch Changes
|
|
125
138
|
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
|
|
139
|
+
- fdde8db: Handle ws closing while buffering
|
|
140
|
+
- 07fe2b9: Wait if WS buffer is full
|
|
141
|
+
- 3bf5127: Allow crashing whole node on peer errors
|
|
142
|
+
- Updated dependencies [b297c93]
|
|
143
|
+
- Updated dependencies [3bf5127]
|
|
144
|
+
- Updated dependencies [a8b74ff]
|
|
145
|
+
- Updated dependencies [db53161]
|
|
146
|
+
- cojson@0.7.33
|
|
134
147
|
|
|
135
148
|
## 0.7.33-hotfixes.5
|
|
136
149
|
|
|
137
150
|
### Patch Changes
|
|
138
151
|
|
|
139
|
-
-
|
|
140
|
-
|
|
152
|
+
- Updated dependencies
|
|
153
|
+
- cojson@0.7.33-hotfixes.5
|
|
141
154
|
|
|
142
155
|
## 0.7.33-hotfixes.4
|
|
143
156
|
|
|
144
157
|
### Patch Changes
|
|
145
158
|
|
|
146
|
-
-
|
|
147
|
-
|
|
159
|
+
- Updated dependencies
|
|
160
|
+
- cojson@0.7.33-hotfixes.4
|
|
148
161
|
|
|
149
162
|
## 0.7.33-hotfixes.3
|
|
150
163
|
|
|
151
164
|
### Patch Changes
|
|
152
165
|
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
|
|
166
|
+
- Allow crashing whole node on peer errors
|
|
167
|
+
- Updated dependencies
|
|
168
|
+
- cojson@0.7.33-hotfixes.3
|
|
156
169
|
|
|
157
170
|
## 0.7.33-hotfixes.2
|
|
158
171
|
|
|
159
172
|
### Patch Changes
|
|
160
173
|
|
|
161
|
-
-
|
|
174
|
+
- Handle ws closing while buffering
|
|
162
175
|
|
|
163
176
|
## 0.7.33-hotfixes.1
|
|
164
177
|
|
|
165
178
|
### Patch Changes
|
|
166
179
|
|
|
167
|
-
-
|
|
180
|
+
- Wait if WS buffer is full
|
|
168
181
|
|
|
169
182
|
## 0.7.33-hotfixes.0
|
|
170
183
|
|
|
171
184
|
### Patch Changes
|
|
172
185
|
|
|
173
|
-
-
|
|
174
|
-
|
|
186
|
+
- Updated dependencies
|
|
187
|
+
- cojson@0.7.33-hotfixes.0
|
|
175
188
|
|
|
176
189
|
## 0.7.31
|
|
177
190
|
|
|
178
191
|
### Patch Changes
|
|
179
192
|
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
|
|
193
|
+
- Properly close connecting websockets
|
|
194
|
+
- Updated dependencies
|
|
195
|
+
- cojson@0.7.31
|
|
183
196
|
|
|
184
197
|
## 0.7.30
|
|
185
198
|
|
|
186
199
|
### Patch Changes
|
|
187
200
|
|
|
188
|
-
-
|
|
201
|
+
- Immediately resolve an already-open websocket
|
|
189
202
|
|
|
190
203
|
## 0.7.29
|
|
191
204
|
|
|
192
205
|
### Patch Changes
|
|
193
206
|
|
|
194
|
-
-
|
|
195
|
-
|
|
207
|
+
- Updated dependencies
|
|
208
|
+
- cojson@0.7.29
|
|
196
209
|
|
|
197
210
|
## 0.7.28
|
|
198
211
|
|
|
199
212
|
### Patch Changes
|
|
200
213
|
|
|
201
|
-
-
|
|
202
|
-
|
|
214
|
+
- Updated dependencies
|
|
215
|
+
- cojson@0.7.28
|
|
203
216
|
|
|
204
217
|
## 0.7.27
|
|
205
218
|
|
|
206
219
|
### Patch Changes
|
|
207
220
|
|
|
208
|
-
-
|
|
221
|
+
- Option to not expect pings
|
|
209
222
|
|
|
210
223
|
## 0.7.26
|
|
211
224
|
|
|
212
225
|
### Patch Changes
|
|
213
226
|
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
|
|
227
|
+
- Remove Effect from jazz/cojson internals
|
|
228
|
+
- Updated dependencies
|
|
229
|
+
- cojson@0.7.26
|
|
217
230
|
|
|
218
231
|
## 0.7.23
|
|
219
232
|
|
|
220
233
|
### Patch Changes
|
|
221
234
|
|
|
222
|
-
-
|
|
223
|
-
|
|
235
|
+
- Updated dependencies
|
|
236
|
+
- cojson@0.7.23
|
|
224
237
|
|
|
225
238
|
## 0.7.22
|
|
226
239
|
|
|
227
240
|
### Patch Changes
|
|
228
241
|
|
|
229
|
-
-
|
|
242
|
+
- Increase disconnect timeout for now
|
|
230
243
|
|
|
231
244
|
## 0.7.18
|
|
232
245
|
|
|
233
246
|
### Patch Changes
|
|
234
247
|
|
|
235
|
-
-
|
|
236
|
-
|
|
248
|
+
- Updated dependencies
|
|
249
|
+
- cojson@0.7.18
|
|
237
250
|
|
|
238
251
|
## 0.7.17
|
|
239
252
|
|
|
240
253
|
### Patch Changes
|
|
241
254
|
|
|
242
|
-
-
|
|
243
|
-
|
|
255
|
+
- Updated dependencies
|
|
256
|
+
- cojson@0.7.17
|
|
244
257
|
|
|
245
258
|
## 0.7.14
|
|
246
259
|
|
|
247
260
|
### Patch Changes
|
|
248
261
|
|
|
249
|
-
-
|
|
250
|
-
|
|
262
|
+
- Updated dependencies
|
|
263
|
+
- cojson@0.7.14
|
|
251
264
|
|
|
252
265
|
## 0.7.11
|
|
253
266
|
|
|
254
267
|
### Patch Changes
|
|
255
268
|
|
|
256
|
-
-
|
|
257
|
-
|
|
269
|
+
- Updated dependencies
|
|
270
|
+
- cojson@0.7.11
|
|
258
271
|
|
|
259
272
|
## 0.7.10
|
|
260
273
|
|
|
261
274
|
### Patch Changes
|
|
262
275
|
|
|
263
|
-
-
|
|
264
|
-
|
|
276
|
+
- Updated dependencies
|
|
277
|
+
- cojson@0.7.10
|
|
265
278
|
|
|
266
279
|
## 0.7.9
|
|
267
280
|
|
|
268
281
|
### Patch Changes
|
|
269
282
|
|
|
270
|
-
-
|
|
271
|
-
|
|
283
|
+
- Updated dependencies
|
|
284
|
+
- cojson@0.7.9
|
|
272
285
|
|
|
273
286
|
## 0.7.0
|
|
274
287
|
|
|
275
288
|
### Patch Changes
|
|
276
289
|
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
|
|
290
|
+
- c4151fc: Support stricter TS lint rules
|
|
291
|
+
- 21771c4: Reintroduce changes from main
|
|
292
|
+
- f0f6f1b: Clean up API more & re-add jazz-nodejs
|
|
293
|
+
- 627d895: Get rid of Co namespace
|
|
294
|
+
- a423eee: ignore error on ws close, fixing "Invalid state: Controller is already closed"
|
|
295
|
+
- Updated dependencies [1a35307]
|
|
296
|
+
- Updated dependencies [96c494f]
|
|
297
|
+
- Updated dependencies [19f52b7]
|
|
298
|
+
- Updated dependencies [d8fe2b1]
|
|
299
|
+
- Updated dependencies [1200aae]
|
|
300
|
+
- Updated dependencies [52675c9]
|
|
301
|
+
- Updated dependencies [1a35307]
|
|
302
|
+
- Updated dependencies [e299c3e]
|
|
303
|
+
- Updated dependencies [bf0f8ec]
|
|
304
|
+
- Updated dependencies [c4151fc]
|
|
305
|
+
- Updated dependencies [8636319]
|
|
306
|
+
- Updated dependencies [952982e]
|
|
307
|
+
- Updated dependencies [21771c4]
|
|
308
|
+
- Updated dependencies [69ac514]
|
|
309
|
+
- Updated dependencies [f0f6f1b]
|
|
310
|
+
- Updated dependencies [1a44f87]
|
|
311
|
+
- Updated dependencies [63374cc]
|
|
312
|
+
- cojson@0.7.0
|
|
300
313
|
|
|
301
314
|
## 0.7.0-alpha.42
|
|
302
315
|
|
|
303
316
|
### Patch Changes
|
|
304
317
|
|
|
305
|
-
-
|
|
306
|
-
|
|
318
|
+
- Updated dependencies
|
|
319
|
+
- cojson@0.7.0-alpha.42
|
|
307
320
|
|
|
308
321
|
## 0.7.0-alpha.41
|
|
309
322
|
|
|
310
323
|
### Patch Changes
|
|
311
324
|
|
|
312
|
-
-
|
|
325
|
+
- ignore error on ws close, fixing "Invalid state: Controller is already closed"
|
|
313
326
|
|
|
314
327
|
## 0.7.0-alpha.39
|
|
315
328
|
|
|
316
329
|
### Patch Changes
|
|
317
330
|
|
|
318
|
-
-
|
|
319
|
-
|
|
331
|
+
- Updated dependencies
|
|
332
|
+
- cojson@0.7.0-alpha.39
|
|
320
333
|
|
|
321
334
|
## 0.7.0-alpha.38
|
|
322
335
|
|
|
323
336
|
### Patch Changes
|
|
324
337
|
|
|
325
|
-
-
|
|
326
|
-
|
|
338
|
+
- Updated dependencies
|
|
339
|
+
- cojson@0.7.0-alpha.38
|
|
327
340
|
|
|
328
341
|
## 0.7.0-alpha.37
|
|
329
342
|
|
|
330
343
|
### Patch Changes
|
|
331
344
|
|
|
332
|
-
-
|
|
333
|
-
|
|
345
|
+
- Updated dependencies
|
|
346
|
+
- cojson@0.7.0-alpha.37
|
|
334
347
|
|
|
335
348
|
## 0.7.0-alpha.36
|
|
336
349
|
|
|
337
350
|
### Patch Changes
|
|
338
351
|
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
|
|
352
|
+
- Updated dependencies [1a35307]
|
|
353
|
+
- Updated dependencies [1a35307]
|
|
354
|
+
- cojson@0.7.0-alpha.36
|
|
342
355
|
|
|
343
356
|
## 0.7.0-alpha.35
|
|
344
357
|
|
|
345
358
|
### Patch Changes
|
|
346
359
|
|
|
347
|
-
-
|
|
348
|
-
|
|
360
|
+
- Updated dependencies
|
|
361
|
+
- cojson@0.7.0-alpha.35
|
|
349
362
|
|
|
350
363
|
## 0.7.0-alpha.29
|
|
351
364
|
|
|
352
365
|
### Patch Changes
|
|
353
366
|
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
|
|
367
|
+
- Reintroduce changes from main
|
|
368
|
+
- Updated dependencies
|
|
369
|
+
- cojson@0.7.0-alpha.29
|
|
357
370
|
|
|
358
371
|
## 0.7.0-alpha.28
|
|
359
372
|
|
|
360
373
|
### Patch Changes
|
|
361
374
|
|
|
362
|
-
-
|
|
363
|
-
|
|
375
|
+
- Updated dependencies
|
|
376
|
+
- cojson@0.7.0-alpha.28
|
|
364
377
|
|
|
365
378
|
## 0.7.0-alpha.27
|
|
366
379
|
|
|
367
380
|
### Patch Changes
|
|
368
381
|
|
|
369
|
-
-
|
|
370
|
-
|
|
382
|
+
- Updated dependencies
|
|
383
|
+
- cojson@0.7.0-alpha.27
|
|
371
384
|
|
|
372
385
|
## 0.7.0-alpha.24
|
|
373
386
|
|
|
374
387
|
### Patch Changes
|
|
375
388
|
|
|
376
|
-
-
|
|
377
|
-
|
|
389
|
+
- Updated dependencies
|
|
390
|
+
- cojson@0.7.0-alpha.24
|
|
378
391
|
|
|
379
392
|
## 0.7.0-alpha.11
|
|
380
393
|
|
|
381
394
|
### Patch Changes
|
|
382
395
|
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
|
|
396
|
+
- Support stricter TS lint rules
|
|
397
|
+
- Updated dependencies
|
|
398
|
+
- cojson@0.7.0-alpha.11
|
|
386
399
|
|
|
387
400
|
## 0.7.0-alpha.10
|
|
388
401
|
|
|
389
402
|
### Patch Changes
|
|
390
403
|
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
|
|
404
|
+
- Clean up API more & re-add jazz-nodejs
|
|
405
|
+
- Updated dependencies
|
|
406
|
+
- cojson@0.7.0-alpha.10
|
|
394
407
|
|
|
395
408
|
## 0.5.2-alpha.2
|
|
396
409
|
|
|
397
410
|
### Patch Changes
|
|
398
411
|
|
|
399
|
-
-
|
|
412
|
+
- Get rid of Co namespace
|
|
400
413
|
|
|
401
414
|
## 0.5.2-alpha.1
|
|
402
415
|
|
|
403
416
|
### Patch Changes
|
|
404
417
|
|
|
405
|
-
-
|
|
406
|
-
|
|
418
|
+
- Updated dependencies
|
|
419
|
+
- cojson@0.7.0-alpha.1
|
|
407
420
|
|
|
408
421
|
## 0.5.2-alpha.0
|
|
409
422
|
|
|
410
423
|
### Patch Changes
|
|
411
424
|
|
|
412
|
-
-
|
|
413
|
-
|
|
425
|
+
- Updated dependencies
|
|
426
|
+
- cojson@0.7.0-alpha.0
|
|
414
427
|
|
|
415
428
|
## 0.5.1
|
|
416
429
|
|
|
417
430
|
### Patch Changes
|
|
418
431
|
|
|
419
|
-
-
|
|
420
|
-
|
|
432
|
+
- Updated dependencies
|
|
433
|
+
- cojson@0.6.0
|
|
421
434
|
|
|
422
435
|
## 0.5.0
|
|
423
436
|
|
|
424
437
|
### Minor Changes
|
|
425
438
|
|
|
426
|
-
-
|
|
439
|
+
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
|
|
427
440
|
|
|
428
441
|
### Patch Changes
|
|
429
442
|
|
|
430
|
-
-
|
|
431
|
-
|
|
443
|
+
- Updated dependencies
|
|
444
|
+
- cojson@0.5.0
|
|
@@ -3,7 +3,7 @@ export const MAX_OUTGOING_MESSAGES_CHUNK_BYTES = 25000;
|
|
|
3
3
|
export class BatchedOutgoingMessages {
|
|
4
4
|
constructor(send) {
|
|
5
5
|
this.send = send;
|
|
6
|
-
this.backlog =
|
|
6
|
+
this.backlog = "";
|
|
7
7
|
this.timeout = null;
|
|
8
8
|
}
|
|
9
9
|
push(msg) {
|
|
@@ -15,7 +15,7 @@ export class BatchedOutgoingMessages {
|
|
|
15
15
|
const backlogExists = this.backlog.length > 0;
|
|
16
16
|
if (maxChunkSizeReached && backlogExists) {
|
|
17
17
|
this.sendMessagesInBulk();
|
|
18
|
-
this.backlog = addMessageToBacklog(
|
|
18
|
+
this.backlog = addMessageToBacklog("", msg);
|
|
19
19
|
this.timeout = setTimeout(() => {
|
|
20
20
|
this.sendMessagesInBulk();
|
|
21
21
|
}, 0);
|
|
@@ -33,7 +33,7 @@ export class BatchedOutgoingMessages {
|
|
|
33
33
|
}
|
|
34
34
|
sendMessagesInBulk() {
|
|
35
35
|
this.send(this.backlog);
|
|
36
|
-
this.backlog =
|
|
36
|
+
this.backlog = "";
|
|
37
37
|
}
|
|
38
38
|
close() {
|
|
39
39
|
this.sendMessagesInBulk();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BatchedOutgoingMessages.js","sourceRoot":"","sources":["../src/BatchedOutgoingMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAM,CAAC;AAExD,MAAM,OAAO,uBAAuB;
|
|
1
|
+
{"version":3,"file":"BatchedOutgoingMessages.js","sourceRoot":"","sources":["../src/BatchedOutgoingMessages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAM,CAAC;AAExD,MAAM,OAAO,uBAAuB;IAIlC,YAAoB,IAAgC;QAAhC,SAAI,GAAJ,IAAI,CAA4B;QAH5C,YAAO,GAAW,EAAE,CAAC;QACrB,YAAO,GAAyC,IAAI,CAAC;IAEN,CAAC;IAExD,IAAI,CAAC,GAAgB;QACnB,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,mBAAmB,GACvB,OAAO,CAAC,MAAM,IAAI,iCAAiC,CAAC;QACtD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QAE9C,IAAI,mBAAmB,IAAI,aAAa,EAAE,CAAC;YACzC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC5C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,EAAE,CAAC,CAAC,CAAC;QACR,CAAC;aAAM,IAAI,mBAAmB,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,EAAE,CAAC,CAAC,CAAC;QACR,CAAC;IACH,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;CACF"}
|