snower/phslock

高性能分布式共享锁服务 PHP 客户端

v1.0.1 2021-12-28 08:49 UTC

This package is auto-updated.

Last update: 2024-09-28 16:03:51 UTC


README

Software license Latest stable Latest development Monthly installs

高性能分布式同步服务和原子数据库。通过锁队列提供良好的多核支持,采用高性能异步二进制网络协议。可用于峰值处理、同步、事件通知、并发控制。 https://github.com/snower/slock

安装

composer require snower/phslock

事件

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Snower\Phslock\Laravel\Facades\Phslock;

class TestSlockEvent extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:slock-event';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $event = Phslock::Event("test", 5, 120, false);
        $event->set();
        return 0;
    }
}

许可协议

phslock 使用 MIT 许可协议,详情请参阅 LICENSE 文件。