Redis client servicestack Timeout
-
27-10-2019 - |
Question
I'm using ServiceStack RedisClient for caching. How can I set a timeout? For example if the result is longer than 5 secs to return null? Anyone knows?
Thanks
Solution
There are some operations like blocking LPOP/RPOP that includes a timeout.
In general redis runs in memory and is extremely fast so its rare that it timesout on its own. However the Network can be down so RedisNativeClient (the base class for RedisClient) includes a SendTimeout
which you can set to do this.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow