Skip to content

Commit f38d260

Browse files
authored
Merge pull request #83 from negezor/update-poem-redis-subscription-redis
Replace deprecated redis calls in poem subscription example
2 parents 0721d90 + 9052c86 commit f38d260

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

poem/subscription-redis/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ async-graphql = { path = "../../.." }
88
async-graphql-poem = { path = "../../../integrations/poem" }
99
tokio = { version = "1.8", features = ["macros", "rt-multi-thread"] }
1010
poem = { version = "3.0.0", features = ["websocket"] }
11-
redis = { version = "0.21.4", features = ["aio", "tokio-comp"] }
11+
redis = { version = "0.25.2", features = ["aio", "tokio-comp"] }
1212
futures-util = "0.3.19"

poem/subscription-redis/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct MutationRoot;
1919
impl MutationRoot {
2020
async fn publish(&self, ctx: &Context<'_>, value: String) -> Result<bool> {
2121
let client = ctx.data_unchecked::<Client>();
22-
let mut conn = client.get_async_connection().await?;
22+
let mut conn = client.get_multiplexed_async_connection().await?;
2323
conn.publish("values", value).await?;
2424
Ok(true)
2525
}
@@ -31,7 +31,7 @@ struct SubscriptionRoot;
3131
impl SubscriptionRoot {
3232
async fn values(&self, ctx: &Context<'_>) -> Result<impl Stream<Item = String>> {
3333
let client = ctx.data_unchecked::<Client>();
34-
let mut conn = client.get_async_connection().await?.into_pubsub();
34+
let mut conn = client.get_async_pubsub().await?;
3535
conn.subscribe("values").await?;
3636
Ok(conn
3737
.into_on_message()

0 commit comments

Comments
 (0)