facing issue with deadpool redis #314
-
|
When using futures::executor::block_on() function with pool.get(), the code is still waiting for a long time, and nothing is happening. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Deadpool itself is executor agnostic (except for timeouts). You're using I don't think it is possilble to use This should work (using tokio): use tokio::runtime::Handle;
let handle = Handle::current();
let conn = handle.block_on(pool.get());Though I really wonder why you want to use deadpool in sync code for fetching an async redis connection object. The only way to use the obtained connection object is via another |
Beta Was this translation helpful? Give feedback.
Deadpool itself is executor agnostic (except for timeouts). You're using
deadpool-rediswhich does call into theredislibrary when creating new connections. Therediscrate only supportstokioorasync-std.I don't think it is possilble to use
futures::executorwith therediscrate. And therefore you can't usefutures::executorwithdeadpool-rediseither.This should work (using tokio):
Though I really wonder why you want to use deadpool in sync code for fetching an async redis connection object. The only way to use the obtained connection object is via another
block_oncall. You'd be bet…