Upgrade actix-ws
crate from 0.2 to 0.3 version (#1267)
- bump up MSRV to 1.75 in `juniper_actix` crate Additionally: - remove redundant `InterruptableStream` definitions in `juniper_graphql_ws` crate Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kai Ren <tyranron@gmail.com>
This commit is contained in:
parent
a4974e179b
commit
caa9495f01
5 changed files with 21 additions and 42 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -150,7 +150,7 @@ jobs:
|
|||
- juniper
|
||||
- juniper_subscriptions
|
||||
- juniper_graphql_ws
|
||||
- juniper_actix
|
||||
#- juniper_actix
|
||||
- juniper_axum
|
||||
- juniper_hyper
|
||||
- juniper_rocket
|
||||
|
@ -159,6 +159,10 @@ jobs:
|
|||
- ubuntu
|
||||
- macOS
|
||||
- windows
|
||||
include:
|
||||
- { msrv: "1.75.0", crate: "juniper_actix", os: "ubuntu" }
|
||||
- { msrv: "1.75.0", crate: "juniper_actix", os: "macOS" }
|
||||
- { msrv: "1.75.0", crate: "juniper_actix", os: "windows" }
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -172,10 +176,6 @@ jobs:
|
|||
- run: cargo +nightly update -Z minimal-versions
|
||||
|
||||
- run: make test.cargo crate=${{ matrix.crate }}
|
||||
if: ${{ matrix.crate != 'juniper_actix' }}
|
||||
# TODO: Remove once MSRV bumps up >=1.75.
|
||||
- run: cargo check -p ${{ matrix.crate }} --all-features
|
||||
if: ${{ matrix.crate == 'juniper_actix' }}
|
||||
|
||||
package:
|
||||
name: check (package)
|
||||
|
|
|
@ -6,6 +6,18 @@ All user visible changes to `juniper_actix` crate will be documented in this fil
|
|||
|
||||
|
||||
|
||||
## master
|
||||
|
||||
### BC Breaks
|
||||
|
||||
- Switched to 0.3 version of [`actix-ws` crate]. ([#1267])
|
||||
- Bumped up [MSRV] to 1.75 due to [`actix-ws` crate] requirements. ([#1267])
|
||||
|
||||
[#1267]: /../../pull/1267
|
||||
|
||||
|
||||
|
||||
|
||||
## [0.5.0] · 2024-03-20
|
||||
[0.5.0]: /../../tree/juniper_actix-v0.5.0/juniper_actix
|
||||
|
||||
|
@ -50,3 +62,4 @@ See [old CHANGELOG](/../../blob/juniper_actix-v0.4.0/juniper_actix/CHANGELOG.md)
|
|||
[Semantic Versioning 2.0.0]: https://semver.org
|
||||
[graphql-transport-ws]: https://github.com/enisdenjo/graphql-ws/blob/v5.14.0/PROTOCOL.md
|
||||
[graphql-ws]: https://github.com/apollographql/subscriptions-transport-ws/blob/v0.11.0/PROTOCOL.md
|
||||
[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "juniper_actix"
|
||||
version = "0.5.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.73"
|
||||
rust-version = "1.75"
|
||||
description = "`juniper` GraphQL integration with `actix-web`."
|
||||
license = "BSD-2-Clause"
|
||||
authors = [
|
||||
|
@ -27,7 +27,7 @@ subscriptions = ["dep:actix-ws", "dep:juniper_graphql_ws"]
|
|||
[dependencies]
|
||||
actix-http = "3.2"
|
||||
actix-web = "4.4"
|
||||
actix-ws = { version = "0.2", optional = true }
|
||||
actix-ws = { version = "0.3", optional = true }
|
||||
anyhow = "1.0.47"
|
||||
futures = "0.3.22"
|
||||
juniper = { version = "0.16", path = "../juniper", default-features = false }
|
||||
|
|
|
@ -290,23 +290,6 @@ impl<S: Schema, I: Init<S::ScalarValue, S::Context>> ConnectionState<S, I> {
|
|||
}
|
||||
}
|
||||
|
||||
struct InterruptableStream<S> {
|
||||
stream: S,
|
||||
rx: oneshot::Receiver<()>,
|
||||
}
|
||||
|
||||
impl<S: Stream + Unpin> Stream for InterruptableStream<S> {
|
||||
type Item = S::Item;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
match Pin::new(&mut self.rx).poll(cx) {
|
||||
Poll::Ready(_) => return Poll::Ready(None),
|
||||
Poll::Pending => {}
|
||||
}
|
||||
Pin::new(&mut self.stream).poll_next(cx)
|
||||
}
|
||||
}
|
||||
|
||||
/// SubscriptionStartState is the state for a subscription operation.
|
||||
enum SubscriptionStartState<S: Schema> {
|
||||
/// Init is the start before being polled for the first time.
|
||||
|
|
|
@ -260,23 +260,6 @@ impl<S: Schema, I: Init<S::ScalarValue, S::Context>> ConnectionState<S, I> {
|
|||
}
|
||||
}
|
||||
|
||||
struct InterruptableStream<S> {
|
||||
stream: S,
|
||||
rx: oneshot::Receiver<()>,
|
||||
}
|
||||
|
||||
impl<S: Stream + Unpin> Stream for InterruptableStream<S> {
|
||||
type Item = S::Item;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
match Pin::new(&mut self.rx).poll(cx) {
|
||||
Poll::Ready(_) => return Poll::Ready(None),
|
||||
Poll::Pending => {}
|
||||
}
|
||||
Pin::new(&mut self.stream).poll_next(cx)
|
||||
}
|
||||
}
|
||||
|
||||
/// SubscriptionStartState is the state for a subscription operation.
|
||||
enum SubscriptionStartState<S: Schema> {
|
||||
/// Init is the start before being polled for the first time.
|
||||
|
|
Loading…
Reference in a new issue