jdalrymple / gitbeaker

๐ŸฆŠ๐Ÿงช A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.55k stars 294 forks source link

Support using AbortController to cancel request to Gitlab? #3561

Open acherkashin opened 6 months ago

acherkashin commented 6 months ago

Description

I make request to new Gitlab().Users.showCurrentUser() to get current user. I have cancel button in my UI. Is it possible to use native const controller = new AbortController() to abort the request to the server?

I think it would be useful for all the methods in the libarry.

Checklist

jdalrymple commented 6 months ago

That should be doable! Right now it uses AbortController under the hood to handle the queryTimeouts. I could expose it to do both query timeouts and external abort signals

acherkashin commented 6 months ago

@jdalrymple it would be great ๐Ÿ‘

jdalrymple commented 5 months ago

Follow up, would you need this on a pure request basis, or on a library config basis. Im guessing the former, but hoping the later because its easier haha

acherkashin commented 5 months ago

@jdalrymple Not sure how it can be implemented on library level, I think it is needed on request level.