From c7754bddfac1993fa342a2d676db20c2646a06ca Mon Sep 17 00:00:00 2001 From: Negezor Date: Sat, 30 Mar 2024 14:03:41 +1100 Subject: [PATCH 1/2] chore(deps): bump redis to 0.25.2 --- poem/subscription-redis/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poem/subscription-redis/Cargo.toml b/poem/subscription-redis/Cargo.toml index 647f4ca..ddd6a30 100644 --- a/poem/subscription-redis/Cargo.toml +++ b/poem/subscription-redis/Cargo.toml @@ -8,5 +8,5 @@ async-graphql = { path = "../../.." } async-graphql-poem = { path = "../../../integrations/poem" } tokio = { version = "1.8", features = ["macros", "rt-multi-thread"] } poem = { version = "2.0.0", features = ["websocket"] } -redis = { version = "0.21.4", features = ["aio", "tokio-comp"] } +redis = { version = "0.25.2", features = ["aio", "tokio-comp"] } futures-util = "0.3.19" From f85b020efbd4fc55f0fe3a115b6172553a3b8570 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sat, 30 Mar 2024 14:04:47 +1100 Subject: [PATCH 2/2] chore: replace deprecated redis calls --- poem/subscription-redis/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poem/subscription-redis/src/main.rs b/poem/subscription-redis/src/main.rs index 7ad4e99..0f11d7c 100644 --- a/poem/subscription-redis/src/main.rs +++ b/poem/subscription-redis/src/main.rs @@ -19,7 +19,7 @@ struct MutationRoot; impl MutationRoot { async fn publish(&self, ctx: &Context<'_>, value: String) -> Result { let client = ctx.data_unchecked::(); - let mut conn = client.get_async_connection().await?; + let mut conn = client.get_multiplexed_async_connection().await?; conn.publish("values", value).await?; Ok(true) } @@ -31,7 +31,7 @@ struct SubscriptionRoot; impl SubscriptionRoot { async fn values(&self, ctx: &Context<'_>) -> Result> { let client = ctx.data_unchecked::(); - let mut conn = client.get_async_connection().await?.into_pubsub(); + let mut conn = client.get_async_pubsub().await?; conn.subscribe("values").await?; Ok(conn .into_on_message()