Figure out the right way to cancel in progress work
- Dominant language
- Go
- Stars
- 40
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
A live stream can stop (for whatever reason) either from the Protocol / Input layer, or from the Control layer. This bi-directional cancellation is currently a mess, and there's some hacky code in place to make it work.
### Reasons for Cancellation
* Control
* Service / Orchestrator failure (unexpected or expected)
* Control shutdown
* Protocol / Input
* Specific disconnect request
* Network io error
### Options
It seems like [context](https://pkg.go.dev/context) may be appropriate for this, however I don't have a ton of experience using it.
Alternatively, depending on the Control architecture, we could use callbacks -- though that's not very "go" like.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by mapping the existing cancellation paths between the Protocol/Input layer and the Control layer, including each listed shutdown, disconnect, and network-error reason. Review Go's context documentation alongside the current hacky cancellation behavior, then define and validate one consistent bidirectional approach that covers all listed cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- audio-video-rtc, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100