MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisAsyncHandleTimeout

Function redisAsyncHandleTimeout

deps/hiredis/async.c:690–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690void redisAsyncHandleTimeout(redisAsyncContext *ac) {
691 redisContext *c = &(ac->c);
692 redisCallback cb;
693
694 if ((c->flags & REDIS_CONNECTED) && ac->replies.head == NULL) {
695 /* Nothing to do - just an idle timeout */
696 return;
697 }
698
699 if (!c->err) {
700 __redisSetError(c, REDIS_ERR_TIMEOUT, "Timeout");
701 }
702
703 if (!(c->flags & REDIS_CONNECTED) && ac->onConnect) {
704 ac->onConnect(ac, REDIS_ERR);
705 }
706
707 while (__redisShiftCallback(&ac->replies, &cb) == REDIS_OK) {
708 __redisRunCallback(ac, &cb, NULL);
709 }
710
711 /**
712 * TODO: Don't automatically sever the connection,
713 * rather, allow to ignore <x> responses before the queue is clear
714 */
715 __redisAsyncDisconnect(ac);
716}
717
718/* Sets a pointer to the first argument and its length starting at p. Returns
719 * the number of bytes to skip to get to the following argument. */

Callers 2

redisLibevTimeoutFunction · 0.85
redisLibeventHandlerFunction · 0.85

Calls 4

__redisSetErrorFunction · 0.85
__redisShiftCallbackFunction · 0.85
__redisRunCallbackFunction · 0.85
__redisAsyncDisconnectFunction · 0.85

Tested by

no test coverage detected