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

Support asynchronous clients and servers #85

Merged
merged 10 commits into from
Nov 8, 2019
Merged

Support asynchronous clients and servers #85

merged 10 commits into from
Nov 8, 2019

Conversation

sfackler
Copy link
Member

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.

sfackler and others added 2 commits October 14, 2019 15:10
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.
Copy link

@bavardage bavardage left a 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?

@sfackler
Copy link
Member Author

Yep

@sfackler sfackler changed the title Support asynchronous clients Support asynchronous clients and servers Oct 16, 2019
@sfackler
Copy link
Member Author

Added support for async servers as well.

@stale
Copy link

stale bot commented Oct 31, 2019

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.

@stale stale bot added the stale label Oct 31, 2019
@stale stale bot removed the stale label Oct 31, 2019
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 {
Copy link
Member Author

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

Choose a reason for hiding this comment

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

Copy link
Member Author

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.

@sfackler sfackler merged commit 961ea58 into master Nov 8, 2019
@sfackler sfackler deleted the async branch November 8, 2019 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants