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

feat: add context.Context support #197

Conversation

natebrennand
Copy link
Contributor

@natebrennand natebrennand commented Oct 30, 2022

Fixes #98

(to be rebased after landing #196)

This PR uses the new alternative base client interfaces, BaseClientWithCtx and RequestHandlerWithCtx, that allow context.Context objects to be provided to every API request. This will allow the Twilio SDK to support context cancellations, and for custom HTTP clients to access the context while executing the request.

The final commit regenerates the SDK with oai-generator changes in this PR:
twilio/twilio-oai-generator#301

The contributions are split by commit, but I can make this 2 separate PR's if you'd like me to separate the SDK regeneration from the client changes.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

Copy link
Contributor

@childish-sambino childish-sambino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Just waiting for upstream PR.

@natebrennand natebrennand force-pushed the natebrennand/regenerate-SDK-with-context-methods branch from dae465a to 4aa4ba2 Compare November 8, 2022 20:12
@natebrennand
Copy link
Contributor Author

Need to regenerate for new API's added, will update

@natebrennand natebrennand force-pushed the natebrennand/regenerate-SDK-with-context-methods branch from 6c8a605 to add173a Compare November 8, 2022 20:30
@childish-sambino childish-sambino merged commit 66288bf into twilio:main Nov 8, 2022
childish-sambino pushed a commit that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

context.Context support is missing
2 participants