Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisResourceManager refactoring #100

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

boesing
Copy link
Member

@boesing boesing commented Jun 21, 2024

Q A
BC Break yes
New Feature yes

Description

The RedisResourceManager is now adapted to work the same way as RedisClusterResourceManager while this also removes a bunch of methods which are not meant to be part of the resource manager.

Added

  • Redis adapter now allows RedisResourceManagerInterface to be set via Redis#setResourceManager
  • Redis has now Redis#getPersistentId which returns the persistent ID in case of persistent connections

Changed

  • RedisClusterResourceManagerInterface#hasSerializationSupport now requires both StorageInterface and PluginCapableInterface
  • RedisCluster#setResourceManager is not marked as internal anymore
  • RedisResourceManager now implements RedisResourceManagerInterface and is reworked to work the same way as RedisClusterResourceManager
  • RedisResourceManager as the resource manager is now RedisOptions aware

Removed

  • Removed RedisClusterResourceManagerInterface#getVersion (which also removes that method from RedisClusterResourceManager as well) - there is no replacement
  • Removed RedisClusterResourceManagerInterface#getLibOption (which also removes that method from RedisClusterResourceManager as well) - Use RedisOptions#getLibOption instead
  • Removed support for ext-redis less than v6.0.0 since RedisResourceManager now instantiates Redis with options which were introduced in 6.0.0
  • Removed obsolete RedisOptions such as resource_id and resource_manager
  • RedisResourceManager#getVersion - use RedisOptions#getVersion instead. There is no way to receive the actual redis-server version from the server itself.
  • RedisResourceManager#hasResource - there is no replacement
  • RedisResourceManager#setResource - there is no replacement
  • RedisResourceManager#removeResource - there is no replacement
  • RedisResourceManager#getMajorVersion - there is no replacement
  • RedisResourceManager#setDatabase - use RedisOptions#setDatabase instead
  • RedisResourceManager#getDatabase - use RedisOptions#getDatabase instead
  • RedisResourceManager#setPassword - use RedisOptions#setPassword instead
  • RedisResourceManager#getPassword - use RedisOptions#getPassword instead
  • RedisResourceManager#getUser - use RedisOptions#getUser instead
  • RedisResourceManager#setUser - use RedisOptions#setUser instead
  • RedisResourceManager#getServer - use RedisOptions#getServer instead
  • RedisResourceManager#setServer - use RedisOptions#setServer instead
  • RedisResourceManager#setPersistentId - use RedisOptions#setPersistentId instead
  • RedisResourceManager#getPersistentId- use RedisOptions#getPersistentId or Redis#getPersistentId instead
  • RedisResourceManager#setLibOptions - use RedisOptions#setLibOptions instead
  • RedisResourceManager#getLibOptions - use RedisOptions#getLibOptions instead

Breaking Changes

  • Removed some options in RedisOptions which also removes the following methods
    • RedisOptions#setResourceId as it is not possible to have multiple shared resources anymore
    • RedisOptions#setResourceManager as the resource manager is now RedisOptions aware
  • Removed option related methods from RedisResourceManager which are mostly replaced by the RedisOptions equivalent
    • RedisResourceManager#getVersion - use RedisOptions#getVersion instead. There is no way to receive the actual redis-server version from the server itself.
    • RedisResourceManager#hasResource - there is no replacement
    • RedisResourceManager#setResource - there is no replacement
    • RedisResourceManager#removeResource - there is no replacement
    • RedisResourceManager#getMajorVersion - there is no replacement
    • RedisResourceManager#setDatabase - use RedisOptions#setDatabase instead
    • RedisResourceManager#getDatabase - use RedisOptions#getDatabase instead
    • RedisResourceManager#setPassword - use RedisOptions#setPassword instead
    • RedisResourceManager#getPassword - use RedisOptions#getPassword instead
    • RedisResourceManager#getUser - use RedisOptions#getUser instead
    • RedisResourceManager#setUser - use RedisOptions#setUser instead
    • RedisResourceManager#getServer - use RedisOptions#getServer instead
    • RedisResourceManager#setServer - use RedisOptions#setServer instead
    • RedisResourceManager#setPersistentId - use RedisOptions#setPersistentId instead
    • RedisResourceManager#getPersistentId- use RedisOptions#getPersistentId or Redis#getPersistentId instead
    • RedisResourceManager#setLibOptions - use RedisOptions#setLibOptions instead
    • RedisResourceManager#getLibOptions - use RedisOptions#getLibOptions instead

@boesing boesing added this to the 3.0.0 milestone Jun 21, 2024
@boesing boesing force-pushed the refactor/redis-resource-manager branch from 0641112 to 87d8664 Compare June 21, 2024 20:41
The `RedisResourceManager` is now adapted to work the same way as `RedisClusterResourceManager` while this also removes a bunch of methods which are not meant to be part of the resource manager.

- `Redis` adapter now allows `RedisResourceManagerInterface` to be set via `Redis#setResourceManager`

- `RedisClusterResourceManagerInterface#hasSerializationSupport` now requires both `StorageInterface` and `PluginCapableInterface`
- `RedisCluster#setResourceManager` is not marked as internal anymore

- `RedisClusterResourceManagerInterface#getVersion`
- `RedisClusterResourceManagerInterface#getLibOption`

Signed-off-by: Maximilian Bösing <[email protected]>
@boesing boesing force-pushed the refactor/redis-resource-manager branch from 87d8664 to 3b61bb6 Compare June 21, 2024 20:43
@boesing boesing linked an issue Jun 21, 2024 that may be closed by this pull request
@boesing boesing force-pushed the refactor/redis-resource-manager branch 2 times, most recently from 1a247f8 to c5fde93 Compare June 21, 2024 21:12
Since we removed the magic which automagically set the persistent id to the options, this method is to provide the persistent id in case we connected to redis using the persistent flag.

If the persistent ID was provided via config, the ID from the config is returned. Otherwise, we return the persistent ID from `ext-redis`.
In case `update` flag is provided, the persistent ID is always returned from `ext-redis`.

Signed-off-by: Maximilian Bösing <[email protected]>
@boesing boesing force-pushed the refactor/redis-resource-manager branch from c5fde93 to 640af62 Compare June 21, 2024 21:15
@boesing boesing merged commit 573ba3b into laminas:3.0.x Jun 21, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactoring of the RedisResourceManager
1 participant