roadrunner-php/symfony-lock-driver

RoadRunner: symfony/lock bridge

v1.0.1 2023-12-18 12:07 UTC

This package is auto-updated.

Last update: 2024-05-03 13:50:49 UTC


README

040fb694-1dd3-4865-9d29-8e0748c2c8b8

RoadRunner Lock Integration for Symfony

PHP Version Require Latest Stable Version phpunit psalm Codecov Total Downloads 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d636861742d6d6167656e74612e737667

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:

composer require roadrunner-php/symfony-lock-driver

Usage

Using the RoadRunner Lock with Symfony is straightforward. Here's a simple example:

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.

Contributing

Contributions are welcome! If you find an issue or have a feature request, please open an issue or submit a pull request.

Credits

License

The MIT License (MIT). Please see License File for more information.