-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support asynchronous clients and servers #85
Conversation
Thanks to async/await the implementation and API of async clients is pretty close to the API of the sync clients! This means that almost all of the codegen is shared, with a flag passed around to make the few changes we need here and there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! so then we're just waiting on rust release + non-alpha tokio?
Yep |
Added support for async servers as well. |
This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days. |
This isn't absolutely required, and unblocks a release. We'll add the impls back once tokio cuts a stable release.
@@ -53,6 +55,37 @@ pub trait Client { | |||
U: VisitResponse<Self::BinaryBody>; | |||
} | |||
|
|||
/// A trait implemented by async HTTP client implementations. | |||
pub trait AsyncClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a rustc bug that prevents us from using #[async_trait]
for this, but that's not a huge deal since we don't expect many things to actually have to implement this. rust-lang/rust#63033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All implementations of that should be generated by conjure-codegen, so there's no real need to make it ergonomic.
Thanks to async/await the implementation and API of async clients is
pretty close to the API of the sync clients! This means that almost all
of the codegen is shared, with a flag passed around to make the few
changes we need here and there.