Skip to content

Cant check the connection state before executing #7

@KnightE

Description

@KnightE

It seems that the only way of getting the connection state, is executing the executor, and checking the reply of batch.
If the redis node goes down, executor will return the result in $timeout ms.
It should not wait the time, and this issue could make big problem in product environment.
Is there any good suggestion? Or did I miss something important?

$libredis = Libredis();
$connection = $libredis->get_connection('127.0.0.1:6379');
$batch = $libredis->create_batch();
$executor = $libredis->create_executor();
$batch->cmd('set', 'foo', 'bar');
$executor->add($connection, $batch);
$executor->execute(1000); // I will wait here for 1000 ms if the connection is broken

Regards
KnightE

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