diff --git a/Cargo.toml b/Cargo.toml index bb0904c2..0256ecaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ default = [ "uuid", ] apollo_tracing = ["chrono"] -apollo_persisted_queries = ["async-mutex", "lru", "sha2"] +apollo_persisted_queries = ["lru", "sha2"] multipart = ["multer", "tempfile"] unblock = ["blocking"] string_number = ["num-traits"] @@ -64,7 +64,6 @@ url = { version = "2.1.1", optional = true } uuid = { version = "0.8.1", optional = true, features = ["v4", "serde"] } # Non-feature optional dependencies -async-mutex = { version = "1.4.0", optional = true } blocking = { version = "1.0.0", optional = true } lru = { version = "0.6.0", optional = true } multer = { version = "1.2.2", optional = true } @@ -74,7 +73,7 @@ tempfile = { version = "3.1.0", optional = true } [dev-dependencies] async-std = { version = "1.6.5", features = ["attributes"] } -async-channel = "1.5.1" +futures-channel = "0.3.8" [package.metadata.docs.rs] features = ["nightly"] diff --git a/src/extensions/apollo_persisted_queries.rs b/src/extensions/apollo_persisted_queries.rs index ffc5bc9d..acef8e74 100644 --- a/src/extensions/apollo_persisted_queries.rs +++ b/src/extensions/apollo_persisted_queries.rs @@ -2,7 +2,7 @@ use std::sync::Arc; -use async_mutex::Mutex; +use futures_util::lock::Mutex; use serde::Deserialize; use sha2::{Digest, Sha256}; diff --git a/tests/subscription_websocket_graphql_ws.rs b/tests/subscription_websocket_graphql_ws.rs index d4b28724..c280e174 100644 --- a/tests/subscription_websocket_graphql_ws.rs +++ b/tests/subscription_websocket_graphql_ws.rs @@ -1,6 +1,8 @@ use async_graphql::http::WebSocketProtocols; use async_graphql::*; +use futures_channel::mpsc; use futures_util::stream::{Stream, StreamExt}; +use futures_util::SinkExt; #[async_std::test] pub async fn test_subscription_ws_transport() { @@ -23,7 +25,7 @@ pub async fn test_subscription_ws_transport() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::GraphQLWS); tx.send( @@ -101,7 +103,7 @@ pub async fn test_subscription_ws_transport_with_token() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::with_data( schema, rx, @@ -205,7 +207,7 @@ pub async fn test_subscription_ws_transport_error() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::GraphQLWS); tx.send( @@ -277,7 +279,7 @@ pub async fn test_query_over_websocket() { } let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::GraphQLWS); tx.send( diff --git a/tests/subscription_websocket_subscriptions_transport_ws.rs b/tests/subscription_websocket_subscriptions_transport_ws.rs index 3209b1ac..1d54bc16 100644 --- a/tests/subscription_websocket_subscriptions_transport_ws.rs +++ b/tests/subscription_websocket_subscriptions_transport_ws.rs @@ -1,6 +1,8 @@ use async_graphql::http::WebSocketProtocols; use async_graphql::*; +use futures_channel::mpsc; use futures_util::stream::{Stream, StreamExt}; +use futures_util::SinkExt; #[async_std::test] pub async fn test_subscription_ws_transport() { @@ -23,7 +25,7 @@ pub async fn test_subscription_ws_transport() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::SubscriptionsTransportWS); tx.send( @@ -101,7 +103,7 @@ pub async fn test_subscription_ws_transport_with_token() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::with_data( schema, rx, @@ -205,7 +207,7 @@ pub async fn test_subscription_ws_transport_error() { } let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::SubscriptionsTransportWS); tx.send( @@ -277,7 +279,7 @@ pub async fn test_query_over_websocket() { } let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); - let (tx, rx) = async_channel::unbounded(); + let (mut tx, rx) = mpsc::unbounded(); let mut stream = http::WebSocket::new(schema, rx, WebSocketProtocols::SubscriptionsTransportWS); tx.send(