承接 sunaoka/process-guard-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sunaoka/process-guard-php

最新稳定版本:v1.0.1

Composer 安装命令:

composer require sunaoka/process-guard-php

包简介

This library has been designed with the intention of preventing the execution of multiple instances of a script.

README 文档

README

Latest License PHP Test codecov

This library has been designed with the intention of preventing the execution of multiple instances of a script.

In the event that it is intended for use in batch processing and a script is already running, all subsequent attempts at execution can be terminated until the current process completes.

Installation

composer require sunaoka/process-guard-php

Basic Usage

use Sunaoka\ProcessGuard\Drivers\FileDriver;
use Sunaoka\ProcessGuard\LockFactory;

$driver = new FileDriver();
$factory = new LockFactory($driver);

$lock = $factory->create('Preventing Multiple Instances', ttl: 60.0);
if ($lock->acquire() === false) {
    // already running
    exit;
}

// You can do some processing

$lock->release();

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-24