Commit 6030a57
fix: add thread safety to SSE connection for realtime flags
- Import threading module at top of client.py
- Add threading.Lock (_sse_lock) for sse_connected flag
- Wrap all sse_connected reads/writes with lock
- Store SSE response and call close() for graceful shutdown
- Ensure thread-safe cleanup in _close_sse_connection()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 1fb9990 commit 6030a57
2 files changed
Lines changed: 20 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
2245 | 2247 | | |
2246 | 2248 | | |
2247 | 2249 | | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
2251 | 2255 | | |
2252 | 2256 | | |
2253 | 2257 | | |
| |||
2274 | 2278 | | |
2275 | 2279 | | |
2276 | 2280 | | |
2277 | | - | |
| 2281 | + | |
| 2282 | + | |
2278 | 2283 | | |
2279 | 2284 | | |
2280 | | - | |
2281 | 2285 | | |
2282 | 2286 | | |
2283 | 2287 | | |
2284 | 2288 | | |
2285 | | - | |
2286 | | - | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
2287 | 2292 | | |
2288 | 2293 | | |
2289 | 2294 | | |
| |||
2304 | 2309 | | |
2305 | 2310 | | |
2306 | 2311 | | |
2307 | | - | |
| 2312 | + | |
| 2313 | + | |
2308 | 2314 | | |
2309 | 2315 | | |
2310 | 2316 | | |
| |||
2338 | 2344 | | |
2339 | 2345 | | |
2340 | 2346 | | |
2341 | | - | |
| 2347 | + | |
| 2348 | + | |
2342 | 2349 | | |
2343 | 2350 | | |
2344 | 2351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
292 | | - | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 310 | + | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
| |||
0 commit comments