Skip to content

Auto connect configured servers #2

@Maykonn

Description

@Maykonn

Problem:

To perform redis commands in a "disconnected"(not instantiated yet) server is necessary call the connect method before call the command:

// don't works without call the connect method before:
$redis->getServersCollection()->getServer('some_server')->some_redis_command();

// works:
$this->redis->connect('some_server');
$redis->getServersCollection()->getServer('some_server')->some_redis_command();

Solution:

Servers configured in config file needs to be auto instantiated when called if not instantiated yet. Maybe a status(CONNECTED, DISCONNECTED) property in RedisServer.php class can help with this.

// this code will auto instantiate the server if not instantiated yet, by calling automatically the connect method:
$redis->getServersCollection()->getServer('some_server')->some_redis_command();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions