Commit f437cd3
committed
feat(core): Harden WebSocket connection with configurable backoff and auto-reconnect (#8177)
- Added 'backoffStrategy' to static config for global/instance customization
- Replaced setTimeout with 'await me.timeout()' for robust lifecycle cleanup
- Added exponential backoff (capped at 30s) to 'attemptReconnect'
- Implemented state reset (reconnectAttempts=0) on successful 'onOpen'
- Added auto-reconnect logic to 'onClose' for abnormal closures
- Added 'reconnecting' and 'reconnect_failed' events1 parent 21b8247 commit f437cd3
1 file changed
Lines changed: 36 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
77 | | - | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
83 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
84 | 96 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
90 | 111 | | |
91 | 112 | | |
92 | 113 | | |
| |||
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
174 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
175 | 202 | | |
176 | 203 | | |
177 | 204 | | |
| |||
200 | 227 | | |
201 | 228 | | |
202 | 229 | | |
| 230 | + | |
203 | 231 | | |
204 | 232 | | |
205 | 233 | | |
| |||
0 commit comments