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(server): remove server::conn::{Http, Connection} types #3013

Merged
merged 1 commit into from Oct 17, 2022

Conversation

seanmonstar
Copy link
Member

The connection types have been split into version-specific types, in the server::conn::{http1, http2} modules.

BREAKING CHANGE: Either choose a version-specific Connection type, or
look for the auto-version type in hyper-util.

Closes #3012

The connection types have been split into version-specific types, in the
`server::conn::{http1, http2}` modules.

BREAKING CHANGE: Either choose a version-specific `Connection` type, or
  look for the auto-version type in `hyper-util`.
@seanmonstar seanmonstar merged commit 0766d3f into master Oct 17, 2022
@seanmonstar seanmonstar deleted the remove-server-conn-combo branch October 17, 2022 17:23
wfly1998 added a commit to cloudwego/volo that referenced this pull request Nov 24, 2023
Note that `hyper` v1.0.0-rc4 replaces IO traits from `tokio` with its
IO traits in `hyper::rt`.  To solve the building problem, we can
introduce `TokioIo` from `hyper-util` and wrap the `DefaultIncoming`
by the `TokioIo`.

Also, the `volo-grpc` uses `hyper` v0.14 with its auto-version
(using both http1 and http2) and graceful shutdown, but the latest
`hyper` and `hyper-util` cannot use the both features at the same
time, so the version of `hyper` in `volo` has not been upgraded.

Ref:
- hyperium/hyper@f9f65b7
- hyperium/hyper#3013
- hyperium/hyper#2862

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
wfly1998 added a commit to cloudwego/volo that referenced this pull request Nov 27, 2023
Note that `hyper` v1.0.0-rc4 replaces IO traits from `tokio` with its
IO traits in `hyper::rt`.  To solve the building problem, we can
introduce `TokioIo` from `hyper-util` and wrap the `DefaultIncoming`
by the `TokioIo`.

Also, the `volo-grpc` uses `hyper` v0.14 with its auto-version
(using both http1 and http2) and graceful shutdown, but the latest
`hyper` and `hyper-util` cannot use the both features at the same
time, so the version of `hyper` in `volo` has not been upgraded.

Ref:
- hyperium/hyper@f9f65b7
- hyperium/hyper#3013
- hyperium/hyper#2862

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
wfly1998 added a commit to cloudwego/volo that referenced this pull request Nov 27, 2023
Note that `hyper` v1.0.0-rc4 replaces IO traits from `tokio` with its
IO traits in `hyper::rt`.  To solve the building problem, we can
introduce `TokioIo` from `hyper-util` and wrap the `DefaultIncoming`
by the `TokioIo`.

Also, the `volo-grpc` uses `hyper` v0.14 with its auto-version
(using both http1 and http2) and graceful shutdown, but the latest
`hyper` and `hyper-util` cannot use the both features at the same
time, so the version of `hyper` in `volo` has not been upgraded.

Ref:
- hyperium/hyper@f9f65b7
- hyperium/hyper#3013
- hyperium/hyper#2862

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
wfly1998 added a commit to cloudwego/volo that referenced this pull request Nov 28, 2023
* feat: introduce volo-http crate

* feat(volo-http): introduce route id

> The `matchit::Router` cannot be converted to `Iterator`, so using
> `matchit::Router<DynService>` is not convenient enough.

> To solve the problem, we refer to the implementation of `axum` and
> introduce a `RouteId` as a bridge, the `matchit::Router` only handles
> some IDs and each ID corresponds to a `DynService`.

* feat(volo-http): wrap `DynService` with `Route`

> With tie type `Route`, it can support `Service`, `Handler` and so on.

* feat(volo-http): make handler more powerful

> With this commit, there is no need to keep `HttpContext` in handler
> function.  Like axum, anything with `FromContext` or `FromRequest`
> trait can be used as arguments of a handler.

* chore(volo-http): bump to hyper 1.0.0

> Note that `hyper` v1.0.0-rc4 replaces IO traits from `tokio` with its
> IO traits in `hyper::rt`.  To solve the building problem, we can
> introduce `TokioIo` from `hyper-util` and wrap the `DefaultIncoming`
> by the `TokioIo`.
> 
> Also, the `volo-grpc` uses `hyper` v0.14 with its auto-version
> (using both http1 and http2) and graceful shutdown, but the latest
> `hyper` and `hyper-util` cannot use the both features at the same
> time, so the version of `hyper` in `volo` has not been upgraded.
> 
> Ref:
> - hyperium/hyper@f9f65b7
> - hyperium/hyper#3013
> - hyperium/hyper#2862

* feat(volo-http): support `with_state`

* fix(volo-http): fix timeout problem of graceful shutdown

> With the previous codes, server could not stop immediately after
> pressing Ctrl+C, but waited until timeout before exiting.
> 
> This commit uses the same approach as "volo-thrift" and the problem
> has been resolved.

* feat(volo-http): support fallback

> This commit supports fallback in `Router` and `MethodRouter`. With
> `fallback`, when no route or method can handle the request, the
> `fallback` will be called and the specified response will be returned.

* feat(volo-http): add `TimeoutLayer` with response

> This commit adds a `TimeoutLayer` for `volo-http` which can use a
> function as a callback and when timeout occurs, it will return a
> response by the callback.

* chore(volo-http): bump version to `0.1.0`

* credits: update license of axum

---------

Signed-off-by: Gwo Tzu-Hsing <gotzehsing@gmail.com>
Signed-off-by: Zheng Li <875543533@qq.com>
Signed-off-by: bobozhengsir <bobozhengsir@gmail.com>
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
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.

Remove the combined-version server Connection type
1 participant