2017 © Pedro Peláez
 

yii2-extension yii2-action-lock-behavior

Allow run only one action instance at once

image

t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  • Thursday, July 12, 2018
  • by tkanstantsin
  • Repository
  • 0 Watchers
  • 0 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Yii Action lock behavior

Yii widget, (*1)

Latest Stable Version Total Downloads, (*2)

Basic

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

Lock source should be chosen carefully noting following:, (*4)

  • 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, (*5)

  • yii\mutex\DbMutex requires db connection. May be used only with single database instance., (*6)

Example

Using mutex from global config:, (*7)


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

Define mutex on-the-fly:, (*8)


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

The Versions

12/07 2018

dev-master

9999999-dev https://github.com/t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 behavior

12/07 2018

1.3

1.3.0.0 https://github.com/t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 behavior

12/07 2018

1.2

1.2.0.0 https://github.com/t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 behavior

09/07 2018

1.1

1.1.0.0 https://github.com/t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 behavior

08/07 2018

1.0

1.0.0.0 https://github.com/t-kanstantsin/yii2-action-lock-behavior

Allow run only one action instance at once

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 behavior