-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05602c3
commit 65c2cc3
Showing
17 changed files
with
109 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Configuration | ||
|
||
### Persistent connections | ||
> *A Redis server is designed to handle a lot of operations per second making it a very good candidate as a data cache storing engine. | ||
But connecting to the server is an expensive operation and thus connections rate should be kept as low as possible.*. | ||
|
||
For more information about persistent connections, read this [article](https://medium.com/assoconnect/how-to-use-persistent-connections-with-redis-for-symfony-cache-with-php-fpm-3e7bd1100736) | ||
|
||
php-redis-om provide a way to use persistent connections with the `RedisClient` class. | ||
|
||
```php | ||
// Set the persistent connection to true | ||
$objectManager = new RedisObjectManager(createPersistentConnection: true); | ||
|
||
// Then you can use the ObjectManager normally | ||
$objectManager->persist($user); | ||
$objectManager->flush(); | ||
``` | ||
|
||
Warning: if you set this parameter to true, the client will connect to the redis server as soon as the object manager is instantiated. Even if the object manager is not actually used. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### Docker | ||
|
||
The package provide a Docker Compose configuration to run a Redis | ||
server with the required modules (RedisJSON and Redisearch) for testing purposes. | ||
|
||
You could retrieve an example in compose.yaml file and a Dockerfile for the PHP container configuration. | ||
|
||
```yaml | ||
redis: | ||
image: redis/redis-stack-server:7.2.0-v6 | ||
ports: | ||
- 6379:6379 | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] | ||
volumes: | ||
- redis_data:/data | ||
``` | ||
To run the Redis server locally, you can use the following command: | ||
```console | ||
docker compose up -d | ||
``` | ||
|
||
### Running tests | ||
|
||
```console | ||
docker compose exec php vendor/bin/phpunit tests | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters