Commit edc8224
committed
Store payloads in a queue when arriving in parallel
When messages arrive very quickly after each other, or the message handler is waiting for the Blob arraybuffer to resolve (it's async), it can happen that another message that arrived in parallel resolves the promise already, loosing the first message.
This commit introduces a payload queue, in which payloads that take longer are stored, and taken out on the next iteration.
Attention: The queue is only processed when a new message arrives.1 parent 0155db2 commit edc8224
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
37 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
| |||
0 commit comments