ScuffleTV / scuffle

Live streaming platform
https://scuffle.tv
232 stars 26 forks source link

feat: cancel task threads #184

Closed TroyKomodo closed 8 months ago

TroyKomodo commented 8 months ago

Proposed changes

Add a new feature which allows for cancel blocking tasks on threads. This allows for long blocking tasks (encoding) to yield back to some checker which unwinds the stack if the task has been aborted. This only works if you call the checker, but for most cases we dont have long running code in C or some other library. So its perfectly fine and fixes a lot of the problems we have with encoding blocking shutdown on tokio::spawn_blocking.

Types of changes

What types of changes does your code introduce to Scuffle? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

-/-