redis-async-rs icon indicating copy to clipboard operation
redis-async-rs copied to clipboard

How to send the 'eval' command

Open xzavierlauml opened this issue 5 years ago • 2 comments

How to send the 'eval' command?Something like this: 127.0.0.1:6379> eval "return 1" 0

xzavierlauml avatar Mar 14 '20 00:03 xzavierlauml

You can do that with the paired connection: https://docs.rs/redis-async/0.6.2/redis_async/client/paired/fn.paired_connect.html

So a rough example would be:

let connection = client::paired_connect(&addr)
        .await
        .expect("Cannot open connection");
let result = connection.send(resp_array!["EVAL", "return 1", "0"]).await;

benashford avatar Mar 14 '20 15:03 benashford

thanks

xzavierlauml avatar Mar 18 '20 05:03 xzavierlauml