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

Add new flags "http-stack" and "async-http-stack" #2246

Open
lmazuel opened this issue Nov 6, 2023 · 0 comments
Open

Add new flags "http-stack" and "async-http-stack" #2246

lmazuel opened this issue Nov 6, 2023 · 0 comments
Labels
feature-request This issue requires a new behavior in the product in order be resolved. need-design needs coding design p1

Comments

@lmazuel
Copy link
Member

lmazuel commented Nov 6, 2023

corehttp will not install any HTTP stack by default, and will require one installed by the SDK itself.

This issue is to add a flag that with those values:

  • http-stack:
    • requests
    • httpx
  • async-http-stack:
    • aiohttp
    • httpx

Default behavior if no flag is requests and aiohttp

Once this flag is set, we need to generate different code:

  • We provide extra_requires to make this experience easier. Change setup.py accordingly to corehttp[requests] or corehttp[httpx] or the combined version corehttp[requests, httpx]
  • Create the right transport in client constructor code to create a transport of the right type, and pass it to the PipelineClient (resp. AsyncPipelineClient. Beware to pop customer 'transport' kwarg as well. Also, the import needs to be inside the constructor, the import is not done if the transport kwarg is set. For instance:
# Pseudo-code, 
transport = kwargs.pop("transport", None)
if not transport:
   from corehttp.transport.httpx import HttpxTransport
   transport = HttpxTransport(**kwargs)
@iscai-msft iscai-msft added p1 need-design needs coding design feature-request This issue requires a new behavior in the product in order be resolved. labels Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requires a new behavior in the product in order be resolved. need-design needs coding design p1
Projects
None yet
Development

No branches or pull requests

2 participants