Is your feature request related to a problem? Please describe.
The SDK's REST-backed methods (Sandbox.create, Sandbox.connect, sandbox.commands.run, sandbox.files.write, etc.) don't accept an AbortSignal. We use signals to cancel in-flight requests, etc. but pending E2B calls can't be cancelled and run to completion regardless.
Describe the solution you'd like
An optional signal: AbortSignal on the request options that aborts the underlying fetch and rejects with an AbortError:
const signal = /* An AbortSignal instance from anywhere */;
await Sandbox.create(template, { apiKey, signal });
await sandbox.commands.run(script, { signal });
Describe alternatives you've considered
Racing each call against the signal with Promise.race. The caller returns early, but the request still runs in the background.
Additional context N/A
Is this something that's possible to add? Any existing solution that I'm missing?
Is your feature request related to a problem? Please describe.
The SDK's REST-backed methods (
Sandbox.create,Sandbox.connect,sandbox.commands.run,sandbox.files.write, etc.) don't accept anAbortSignal. We use signals to cancel in-flight requests, etc. but pending E2B calls can't be cancelled and run to completion regardless.Describe the solution you'd like
An optional
signal: AbortSignalon the request options that aborts the underlyingfetchand rejects with anAbortError:Describe alternatives you've considered
Racing each call against the signal with
Promise.race. The caller returns early, but the request still runs in the background.Additional context N/A
Is this something that's possible to add? Any existing solution that I'm missing?