[📖] Add docs about `AbortSignal` in `server$` API
Suggestion
#4214 added support for AbortSignal in server$ API
However, it's undocumented and not that clear how to use it.
server$ - streaming responses seems like a good place where to add docs for this feature.
@DanielAdolfsson since you were the author of this feature, would you be willing to add docs?
Sure, I can do that! But it seems like it's still up in the air - got a suggestion to change the API to return a cancelable promise instead of passing an AbortSignal. Once that's been cleared up, I'll update the docs.
thanks @DanielAdolfsson for taking this over 🙏
~~The AbortSignal implementation was a bit hacky, and it could only effectively be used to cancel long running async generators. #4290 reverts the AbortSignal change and instead focuses on proper async generator cleanup, meaning that the connection will end if the client breaks out from the generator loop (or otherwise call return() on the async generator). Is this something I should mention in the docs?~~
Removing the AbortSignal signature just makes is harder. I'd have to implement an CancellablePromise, as well as a CancellableAsyncGenerator. It felt a bit hacky, but I think it's probably better to keep it for now.