Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Callbacks not called after looking up non-existing key #86

@andres-halls

Description

@andres-halls

Hi, are the callbacks not supposed to be called when looking up a key that doesn't exist?

For example:

cpp_redis::redis_client redisClient;
redisClient.connect();

redisClient.get("doesnotexist", [](cpp_redis::reply& reply) {
    std::cout << reply << std::endl; // Never executed
});

redisClient.sync_commit(std::chrono::milliseconds(100));

Code is in a try/catch block and no exception is thrown either.

Also, when reusing the open connection and not instantiating a new client, subsequent get calls will not have their callbacks invoked anymore even if the key does exist. Example:

cpp_redis::redis_client redisClient;
redisClient.connect();

redisClient.get("doesnotexist", [](cpp_redis::reply& reply) {
    std::cout << reply << std::endl; // Never executed
});

redisClient.sync_commit(std::chrono::milliseconds(100));

redisClient.get("existingkey", [](cpp_redis::reply& reply) {
    std::cout << reply << std::endl; // Also never executed
});

redisClient.sync_commit(std::chrono::milliseconds(100));

I previously used the future_client, but looking up a non-existing key caused future.get() to block indefinitely.

EDIT: Actually, instantiating a new client every time does not fix it either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions