effect-aws icon indicating copy to clipboard operation
effect-aws copied to clipboard

AbortController

Open godu opened this issue 8 months ago • 0 comments

https://aws.amazon.com/blogs/developer/abortcontroller-in-modular-aws-sdk-for-javascript/

I think it must be easy to implement cancellation.

--  return (input: Input, options?: __HttpHandlerOptions) =>
++  return (input: Input, options?: Omit<__HttpHandlerOptions, 'abortSignal'>) =>
    Effect.tryPromise({
--    try: () => client.send(new Command(input), options ?? {}),
++	  try: (abortSignal) => client.send(new Command(input), {...options, abortSignal} ?? {abortSignal}),
      catch: (e) => ...
    })

godu avatar May 29 '24 12:05 godu