Skip to content

Commit

Permalink
Upgrade actix-ws crate from 0.2 to 0.3 version (#1267)
Browse files Browse the repository at this point in the history
- 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kai Ren <[email protected]>
  • Loading branch information
dependabot[bot] and tyranron authored Jul 23, 2024
1 parent a4974e1 commit caa9495
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 42 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
- juniper
- juniper_subscriptions
- juniper_graphql_ws
- juniper_actix
#- juniper_actix
- juniper_axum
- juniper_hyper
- juniper_rocket
Expand All @@ -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
Expand All @@ -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)
Expand Down
15 changes: 14 additions & 1 deletion juniper_actix/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -49,4 +61,5 @@ See [old CHANGELOG](/../../blob/juniper_actix-v0.4.0/juniper_actix/CHANGELOG.md)
[`juniper_graphql_ws` crate]: https://docs.rs/juniper_graphql_ws
[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
[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
4 changes: 2 additions & 2 deletions juniper_actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 }
Expand Down
17 changes: 0 additions & 17 deletions juniper_graphql_ws/src/graphql_transport_ws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 0 additions & 17 deletions juniper_graphql_ws/src/graphql_ws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit caa9495

Please sign in to comment.