• A
    Blocking POP: use a dictionary to store keys clinet side. · 54b08c86
    antirez 提交于
    To store the keys we block for during a blocking pop operation, in the
    case the client is blocked for more data to arrive, we used a simple
    linear array of redis objects, in the blockingState structure:
    
        robj **keys;
        int count;
    
    However in order to fix issue #801 we also use a dictionary in order to
    avoid to end in the blocked clients queue for the same key multiple
    times with the same client.
    
    The dictionary was only temporary, just to avoid duplicates, but since
    we create / destroy it there is no point in doing this duplicated work,
    so this commit simply use a dictionary as the main structure to store
    the keys we are blocked for. So instead of the previous fields we now
    just have:
    
        dict *keys;
    
    This simplifies the code and reduces the work done by the server during
    a blocking POP operation.
    54b08c86
redis.h 50.1 KB