Remove `async-channel` and `async-mutex` from dependencies.

This commit is contained in:
Sunli 2020-12-17 10:05:32 +08:00
parent 8bc6524895
commit c6d8df0bdb
4 changed files with 15 additions and 12 deletions

View File

@ -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"]

View File

@ -2,7 +2,7 @@
use std::sync::Arc;
use async_mutex::Mutex;
use futures_util::lock::Mutex;
use serde::Deserialize;
use sha2::{Digest, Sha256};

View File

@ -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(

View File

@ -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(