MCPcopy Create free account
hub / github.com/F-Stack/f-stack / scanDatabaseForReadyLists

Function scanDatabaseForReadyLists

app/redis-6.2.6/src/db.c:1308–1317  ·  view source on GitHub ↗

Helper function for dbSwapDatabases(): scans the list of keys that have * one or more blocked clients for B[LR]POP or other blocking commands * and signal the keys as ready if they are of the right type. See the comment * where the function is used for more info. */

Source from the content-addressed store, hash-verified

1306 * and signal the keys as ready if they are of the right type. See the comment
1307 * where the function is used for more info. */
1308void scanDatabaseForReadyLists(redisDb *db) {
1309 dictEntry *de;
1310 dictIterator *di = dictGetSafeIterator(db->blocking_keys);
1311 while((de = dictNext(di)) != NULL) {
1312 robj *key = dictGetKey(de);
1313 robj *value = lookupKey(db,key,LOOKUP_NOTOUCH);
1314 if (value) signalKeyAsReady(db, key, value->type);
1315 }
1316 dictReleaseIterator(di);
1317}
1318
1319/* Swap two databases at runtime so that all clients will magically see
1320 * the new database even if already connected. Note that the client

Callers 1

dbSwapDatabasesFunction · 0.85

Calls 5

dictGetSafeIteratorFunction · 0.85
lookupKeyFunction · 0.85
signalKeyAsReadyFunction · 0.85
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected