Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic streaming interface #946

Open
endgame opened this issue Jul 28, 2023 · 2 comments
Open

Generic streaming interface #946

endgame opened this issue Jul 28, 2023 · 2 comments

Comments

@endgame
Copy link
Collaborator

endgame commented Jul 28, 2023

I wonder if we can break the direct dependency on conduit. paginateEither really only needs some kind of function to yield into.

On the consumption side, we really just need an action m (Maybe ByteString) which we can repeatedly invoke, and can build that out of unconsM or your streaming library's equivalent.

@brendanhay
Copy link
Owner

brendanhay commented Jul 28, 2023

There was originally some movement around removing it - but Route53's (and S3 at one point) XML interface use{d.s} xml-conduit so the transitive dependency existed anyway. If that is rendered unnecessary the next step is generate data types that are free over some body type variable (or m body, whatever). That is, requests need it in addition to responses:

data PutObject body = PutObject'
  { acl :: Prelude.Maybe ObjectCannedACL,
    bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    cacheControl :: Prelude.Maybe Prelude.Text,
    contentDisposition :: Prelude.Maybe Prelude.Text,
    contentEncoding :: Prelude.Maybe Prelude.Text,
...
    body :: body
  }

@endgame
Copy link
Collaborator Author

endgame commented Jul 30, 2023

Neither amazonka-route53 nor amazonka-s3 seem to depend on xml-conduit these days, but a more fundamental direct dependency is amazonka-core's reliance on http-conduit, which I can't see us easily fixing. And since most of the HTTP stuff is built on Snoymanverse libraries I don't see us being able to provide a completely streaming-agnostic interface here. The best thing we can do, I think, is write wrappers in separate libraries (amazonka-streaming, amazonka-pipes, except that latter name is used for EventBridge Pipes) which convert to conduits as the final step before handing the streaming body off to amazonka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants