feat(node): push USB changes and preserve sensor setup across sessions

This commit is contained in:
DCCONSTRUCTIONS
2026-09-06 00:24:48 +03:00
parent a8647c4d87
commit 22d69107ba
24 changed files with 636 additions and 60 deletions
+23
View File
@@ -0,0 +1,23 @@
import asyncio
import threading
from k1link.fleet.events import FleetEvents
def test_registry_events_cross_thread_coalesce_and_unsubscribe():
async def check():
events = FleetEvents()
queue, close = events.subscribe()
thread = threading.Thread(target=lambda: [events.notify() for _ in range(20)])
thread.start()
thread.join()
await asyncio.sleep(0)
assert queue.qsize() == 1
await queue.get()
close()
events.notify()
await asyncio.sleep(0)
assert queue.empty()
assert not events.listeners
asyncio.run(check())