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. */
| 1700 | * and signal the keys as ready if they are of the right type. See the comment |
| 1701 | * where the function is used for more info. */ |
| 1702 | void scanDatabaseForReadyLists(redisDb *db) { |
| 1703 | dictEntry *de; |
| 1704 | dictIterator *di = dictGetSafeIterator(db->blocking_keys); |
| 1705 | while((de = dictNext(di)) != NULL) { |
| 1706 | robj *key = (robj*)dictGetKey(de); |
| 1707 | robj *value = lookupKey(db,key,LOOKUP_NOTOUCH); |
| 1708 | if (value) signalKeyAsReady(db, key, value->type); |
| 1709 | } |
| 1710 | dictReleaseIterator(di); |
| 1711 | } |
| 1712 | |
| 1713 | /* Swap two databases at runtime so that all clients will magically see |
| 1714 | * the new database even if already connected. Note that the client |
no test coverage detected