elranu
elranu

Reputation: 2312

Redis client servicestack Timeout

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

Upvotes: 1

Views: 970

Answers (1)

mythz
mythz

Reputation: 143399

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.

Upvotes: 2

Related Questions