承接 t-kanstantsin/yii2-action-lock-behavior 相关项目开发

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

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

t-kanstantsin/yii2-action-lock-behavior

Composer 安装命令:

composer require t-kanstantsin/yii2-action-lock-behavior

包简介

Allow run only one action instance at once

README 文档

README

Yii widget

Latest Stable Version Total Downloads

Basic

Behavior allow deny multiple runs of same console application action (e.g. long time executing task initiated with cron) using yii\mutex\* package.

Lock source should be chosen carefully noting following:

  • yii\mutex\FileMutex simple but can be used only with one docker container instance because its not possible determine if process still running or ended in another container. Requires only writable directory

  • yii\mutex\DbMutex requires db connection. May be used only with single database instance.

Example

Using mutex from global config:

    public function behaviors(): array
    {
        return [
            'pid' => ActionLockBehavior::class,
        ];
    }

Define mutex on-the-fly:

    public function behaviors(): array
    {
        return [
            'pid' => [
                'class' => ActionLockBehavior::class,
                'mutex' => [
                    'class' => FileMutex::class,
                    'mutexPath' => \Yii::getAlias('@runtime/pid'),
                ],
            ],
        ];
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固