문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top