Skip to content

Commit caa9495

Browse files
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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kai Ren <[email protected]>
1 parent a4974e1 commit caa9495

File tree

5 files changed

+21
-42
lines changed

5 files changed

+21
-42
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
- juniper
151151
- juniper_subscriptions
152152
- juniper_graphql_ws
153-
- juniper_actix
153+
#- juniper_actix
154154
- juniper_axum
155155
- juniper_hyper
156156
- juniper_rocket
@@ -159,6 +159,10 @@ jobs:
159159
- ubuntu
160160
- macOS
161161
- windows
162+
include:
163+
- { msrv: "1.75.0", crate: "juniper_actix", os: "ubuntu" }
164+
- { msrv: "1.75.0", crate: "juniper_actix", os: "macOS" }
165+
- { msrv: "1.75.0", crate: "juniper_actix", os: "windows" }
162166
runs-on: ${{ matrix.os }}-latest
163167
steps:
164168
- uses: actions/checkout@v4
@@ -172,10 +176,6 @@ jobs:
172176
- run: cargo +nightly update -Z minimal-versions
173177

174178
- run: make test.cargo crate=${{ matrix.crate }}
175-
if: ${{ matrix.crate != 'juniper_actix' }}
176-
# TODO: Remove once MSRV bumps up >=1.75.
177-
- run: cargo check -p ${{ matrix.crate }} --all-features
178-
if: ${{ matrix.crate == 'juniper_actix' }}
179179

180180
package:
181181
name: check (package)

juniper_actix/CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ All user visible changes to `juniper_actix` crate will be documented in this fil
66

77

88

9+
## master
10+
11+
### BC Breaks
12+
13+
- Switched to 0.3 version of [`actix-ws` crate]. ([#1267])
14+
- Bumped up [MSRV] to 1.75 due to [`actix-ws` crate] requirements. ([#1267])
15+
16+
[#1267]: /../../pull/1267
17+
18+
19+
20+
921
## [0.5.0] · 2024-03-20
1022
[0.5.0]: /../../tree/juniper_actix-v0.5.0/juniper_actix
1123

@@ -49,4 +61,5 @@ See [old CHANGELOG](/../../blob/juniper_actix-v0.4.0/juniper_actix/CHANGELOG.md)
4961
[`juniper_graphql_ws` crate]: https://docs.rs/juniper_graphql_ws
5062
[Semantic Versioning 2.0.0]: https://semver.org
5163
[graphql-transport-ws]: https://github.com/enisdenjo/graphql-ws/blob/v5.14.0/PROTOCOL.md
52-
[graphql-ws]: https://github.com/apollographql/subscriptions-transport-ws/blob/v0.11.0/PROTOCOL.md
64+
[graphql-ws]: https://github.com/apollographql/subscriptions-transport-ws/blob/v0.11.0/PROTOCOL.md
65+
[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field

juniper_actix/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "juniper_actix"
33
version = "0.5.0"
44
edition = "2021"
5-
rust-version = "1.73"
5+
rust-version = "1.75"
66
description = "`juniper` GraphQL integration with `actix-web`."
77
license = "BSD-2-Clause"
88
authors = [
@@ -27,7 +27,7 @@ subscriptions = ["dep:actix-ws", "dep:juniper_graphql_ws"]
2727
[dependencies]
2828
actix-http = "3.2"
2929
actix-web = "4.4"
30-
actix-ws = { version = "0.2", optional = true }
30+
actix-ws = { version = "0.3", optional = true }
3131
anyhow = "1.0.47"
3232
futures = "0.3.22"
3333
juniper = { version = "0.16", path = "../juniper", default-features = false }

juniper_graphql_ws/src/graphql_transport_ws/mod.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -290,23 +290,6 @@ impl<S: Schema, I: Init<S::ScalarValue, S::Context>> ConnectionState<S, I> {
290290
}
291291
}
292292

293-
struct InterruptableStream<S> {
294-
stream: S,
295-
rx: oneshot::Receiver<()>,
296-
}
297-
298-
impl<S: Stream + Unpin> Stream for InterruptableStream<S> {
299-
type Item = S::Item;
300-
301-
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
302-
match Pin::new(&mut self.rx).poll(cx) {
303-
Poll::Ready(_) => return Poll::Ready(None),
304-
Poll::Pending => {}
305-
}
306-
Pin::new(&mut self.stream).poll_next(cx)
307-
}
308-
}
309-
310293
/// SubscriptionStartState is the state for a subscription operation.
311294
enum SubscriptionStartState<S: Schema> {
312295
/// Init is the start before being polled for the first time.

juniper_graphql_ws/src/graphql_ws/mod.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,6 @@ impl<S: Schema, I: Init<S::ScalarValue, S::Context>> ConnectionState<S, I> {
260260
}
261261
}
262262

263-
struct InterruptableStream<S> {
264-
stream: S,
265-
rx: oneshot::Receiver<()>,
266-
}
267-
268-
impl<S: Stream + Unpin> Stream for InterruptableStream<S> {
269-
type Item = S::Item;
270-
271-
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
272-
match Pin::new(&mut self.rx).poll(cx) {
273-
Poll::Ready(_) => return Poll::Ready(None),
274-
Poll::Pending => {}
275-
}
276-
Pin::new(&mut self.stream).poll_next(cx)
277-
}
278-
}
279-
280263
/// SubscriptionStartState is the state for a subscription operation.
281264
enum SubscriptionStartState<S: Schema> {
282265
/// Init is the start before being polled for the first time.

0 commit comments

Comments
 (0)