https://github.com/roadrunner-php/symfony-lock-driver
RoadRunner lock driver for Symfony Lock component
https://github.com/roadrunner-php/symfony-lock-driver
atomic-lock lock php roadrunner spiral
Last synced: 6 months ago
JSON representation
RoadRunner lock driver for Symfony Lock component
- Host: GitHub
- URL: https://github.com/roadrunner-php/symfony-lock-driver
- Owner: roadrunner-php
- License: mit
- Created: 2023-09-05T07:56:24.000Z (over 2 years ago)
- Default Branch: 1.x
- Last Pushed: 2025-05-30T07:51:36.000Z (10 months ago)
- Last Synced: 2025-09-08T22:29:57.855Z (7 months ago)
- Topics: atomic-lock, lock, php, roadrunner, spiral
- Language: PHP
- Homepage: https://symfony.com/doc/current/components/lock.html
- Size: 43 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RoadRunner Lock Integration for Symfony
[](https://packagist.org/packages/roadrunner-php/symfony-lock-driver)
[](https://packagist.org/packages/roadrunner-php/symfony-lock-driver)
[](https://github.com/roadrunner-php/symfony-lock-driver/actions)
[](https://github.com/roadrunner-php/symfony-lock-driver/actions)
[](https://codecov.io/gh/roadrunner-php/symfony-lock-driver/)
[](https://packagist.org/roadrunner-php/symfony-lock-driver/phpunit)

This package is a bridge that connects the powerful RoadRunner Lock plugin with the Symfony Lock component. It's
designed to help you easily manage distributed locks in your PHP applications, particularly when you're working with
high-traffic web applications and microservices.
## Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
## Installation
You can install the package via composer:
```bash
composer require roadrunner-php/symfony-lock-driver
```
## Usage
Using the RoadRunner Lock with Symfony is straightforward. Here's a simple example:
```php
use RoadRunner\Lock\Lock;
use Spiral\Goridge\RPC\RPC;
use Spiral\RoadRunner\Symfony\Lock\RoadRunnerStore;
use Symfony\Component\Lock\LockFactory;
require __DIR__ . '/vendor/autoload.php';
$lock = new Lock(RPC::create('tcp://127.0.0.1:6001'));
$factory = new LockFactory(
new RoadRunnerStore($lock)
);
```
Read more about using Symfony Lock component [here](https://symfony.com/doc/current/components/lock.html).
## Contributing
Contributions are welcome! If you find an issue or have a feature request, please open
an [issue](https://github.com/roadrunner-php/issues) or submit a pull request.
## Credits
- [gam6itko](https://github.com/gam6itko)
- [butschster](https://github.com/butschster)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.