* Added support for redis gears trigger function commands
* Exclude gears tests from relay connection tests
* Codestyle fixes
* Added missing test coverage
* Updated method description
* Use redis-stack:edge image istead of separate container
* Updated RESP3 modules responses
* Removed redundant constants
* Added additional timeout to make sure that index was created
* Marked test as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Increase timeout after index creation
* Added support for trigger functions command run against OSS cluster
* Mark gears cluster tests with appropriate annotation
* Marked with cluster annotation
* Codestyle fixes
* Removed refresh cluster on connection, moved to refresh manually in tests
* Removed redundant test
* Updated README, added comments with README references
* Revert "Marked test as relay-incompatible"
This reverts commit d888968b7b.
* Revert changes
* Revert "Mark tests as relay-incompatible"
This reverts commit 7d34370c6b.
* Revert "Updated RESP3 modules responses"
This reverts commit 5cf122ad71.
* Removed latest image
* Updated RESP3 modules responses (#4)
* Marked tests as relay-incompatible (#3)
* Marked test as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Changed tests group for RESP3 not supported tests
* Fixed broken tests
* Removed redundant test
* Marked test as relay-incompatible
* Codestyle fixes
* Updated CHANGELOG.md
* Updated CHANGELOG.md
* Revert php-cs-fixer style changes
---------
Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Added client metadata on server connection
* Added try...catch around server exception to supress CLIENT command errors
* Added exclusion for Relay connection
* Added client metadata on server connection
* Added try...catch around server exception to supress CLIENT command errors
* Added exclusion for Relay connection
* Changed array index
* Added support for sharded pub/sub consumer
* Removed query parameter
* Fix typo
* Codestyle fixes
* Added support for sharded pub/sub against DispatcherLoop
* Updated sharded consumer example to subscribe on differend shard channels
* Added test coverage
* Removed cluster condition for pub/sub
* Codestyle fixes
* Changed socket read interface, added parameters as dependency to cluster connection
* Added for interface consistency
* Updated method description
* Updated method description
* Removed redundant exception
* Codestyle fix
* Updated README
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Moved sharded pub/sub functionality to new consumer
* Codestyle fixes
* Resolve context depends on connection type
* Codestyle fixes
See commit dd5d665 for the above mentioned changes.
Tests for Option\Aggregate, Option\Replication and Option\Cluster should
be refactored because code is a bit too repetitive and a bunch of tests
are shared among them (replication and cluster options extend aggregate
and share the same logic after all).
The "at" matcher will be removed in PHPUnit 10 but it is not a bad thing
after all because it was cumbersome and error-prone.
Took the opportunity to improve some tests while converting them.
- Make use of more typehints for function parameters
- Make use of typehints for function return values
- Use @var where needed to give proper hints to IDEs and avoid warnings
- Replace MockObject::setMethods() with addMethods() and onlyMethods()
- Rewording of some phpdocs
We have renamed most methods to drop the "command" suffix as it is quite
redundant. Due to this change and thanks to variadic methods introduced
with PHP 5.6 we took the opportunity to replace both "supportsCommand()"
and "supportsCommands()" with a single new method "supports()".
Added more stringent typehints for method arguments and typehints for
return values now that we do not need to support anything below PHP 7.2.
Also moved from using array() to [] in source code of class involved.
The previous implementation was not good because we were exposing in the
public API an internal implementation detail of the base factory class,
furthermore it made Predis\Command\Factory::define() confusing. Having a
separate method to undefine commands in the factory is self-explanatory.
We also changed `Predis\Configuration\Option\Commands` accordingly when
a dictionary of $commandID => $classCommand is passed to the "commands"
client option and $classCommand is NULL.
A few minor changes (mostly cosmetic or documentation) were applied too.
From feedback to PR #644.
There was no real meaning to have a callback here, for the most part it
was just a leftover of a previous approach implemented with ee7104d and
quickly superseded by the current approach that simply returns the new
client instance instead of using callbacks.
From feedback to #644.
This change does not affect distribution but simply separates the two
concepts of connection ID (ip:port pair) and alias (value set via the
"alias" connection parameter), the method getConnectionByAlias() has
been added to reflect this change.
The method getConnectionBySlot() has also been added.
When using replication backends, now the role of a connection is not
defined by its alias but by the new connection parameter "role" that
can be set to "master", "slave" and (for redis-sentinel) "sentinel".
This also led to a redesign of how connections can be retrieved from
replication backends: the method getConnectionById() now retrieves a
connection only by its ID (ip:port pair), to get a connection by its
alias there is the new method getConnectionByAlias(). This method is
not supported by the redis-sentinel backend due to its dynamic nature
(connections are retrieved and initialized at runtime from sentinels)
but it is still possible to get a single connection from the pool by
using its ID. It is also possible to retrive a connection by its role
using the method getConnectionByRole().
NOTE: the "role" parameter is an hint for the internals of aggregate
connection backends so it is still possible that the actual role of
a connection changes during the execution of a script (e.g. a slave
gets promoted to the role of master): in this case the parameters of
that connection will not be changed as they are immutable, but the
method getConnectionByRole() will return the appropriate connection.
Predis\Client::getClientBy() has been updated with the addition of
"role" and "alias" as supported selectors.
This method improves the previous one, which worked only by picking a
connection by ID, allowing users to specify a selector type among the
following ones: "id", "key", "slot", "command". These selectors are
expanded internally to methods, invoked against the connection object
in use by the client, that follow the getConnectionByXXX() convention
already in use through the library:
id => getConnectionById()
key => getConnectionByKey()
slot => getConnectionBySlot()
command => getConnectionByCommand()
The underlying connection does not necessarily need to implement the
aggregate connection interface as the client relies on a duck-typing
approach by using method_exists().