Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks to the interruptStream (viamrobotics#4259)
My original plan was to move this to using a `StoppableWorkers`, so that we definitely shut down the background goroutine when we call `closeStream()` (right now, it cancels the context and returns without waiting for the goroutine to actually stop). However, this is trickier than I realized: the context that is canceled is _not_ descended from the background context: it's passed in as an argument and might be canceled by something else! So, this PR is some preliminary cleanup without using a `StoppableWorkers` yet. Thanks to Olivia for pointing out that we don't actually need to wait for the background goroutine to start up, and can return immediately without those syncing up. Tried on an rpi5 with a modular board component and a modular ultrasonic sensor (so, streaming interrupts from one module to the RDK, and then streaming those same interrupts from the RDK to another module): everything works great!
- Loading branch information