spiral / roadrunner-bridge

šŸŒ‰ RoadRunner bridge to Spiral Framework
https://spiral.dev/docs/packages-roadrunner-bridge
MIT License
12 stars 6 forks source link

RoadRunner Lock Plugin Integration #94

Closed butschster closed 8 months ago

butschster commented 8 months ago

This integration marks a significant enhancement in our capability to handle resource locks efficiently in PHP applications, leveraging the power and speed of GO.

What is the RoadRunner Lock Plugin?

The RoadRunner lock plugin is a sophisticated tool designed for managing resource locks in applications through the RPC protocol. By combining the robustness of GO with the flexibility of PHP, it offers a solution that is both lightweight and speedy, ensuring reliable lock acquisition, release, and management.

Read more: https://roadrunner.dev/docs/plugins-locks

Getting Started

To utilize this feature, simply register the Spiral\RoadRunnerBridge\Bootloader\LockBootloader in your application.

Here's a quick snippet to get you started:

use Spiral\RoadRunnerBridge\Bootloader as RoadRunnerBridge;

protected const LOAD = [
    // ...
    RoadRunnerBridge\LockBootloader::class,
    // ...
];

That's all it takes! No additional configuration is required on the RoadRunner side.

Usage Example

Here's a brief example of how you can use locks in your application:

$locks = $container->get(\RoadRunner\Lock\LockInterface::class);
$id = $lock->lock('pdf:create');

// Your logic for creating a PDF file

$lock->release('pdf:create', $id);
Q A
Bugfix? āŒ
Breaks BC? āŒ
New feature? āœ”ļø
Issues #93
codecov[bot] commented 8 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (f428e6b) 93.10% compared to head (fa542f8) 93.11%.

Files Patch % Lines
src/Bootloader/LockBootloader.php 0.00% 8 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 3.x #94 +/- ## ============================================ + Coverage 93.10% 93.11% +0.01% - Complexity 340 351 +11 ============================================ Files 63 64 +1 Lines 1058 1177 +119 ============================================ + Hits 985 1096 +111 - Misses 73 81 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.