floydspace / effect-aws

🚰 Effectful AWS
https://floydspace.github.io/effect-aws/
MIT License
39 stars 4 forks source link

AbortController #50

Closed godu closed 1 month ago

godu commented 5 months ago

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) => ...
    })
floydspace commented 1 month ago

this is done