mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Doc comments for the 'mutex' classes extended
This commit is contained in:
@ -13,6 +13,10 @@ use yii\base\InvalidConfigException;
|
||||
use yii\di\Instance;
|
||||
|
||||
/**
|
||||
* DbMutex is the base class for classes, which relies on database while implementing mutex "lock" mechanism.
|
||||
*
|
||||
* @see Mutex
|
||||
*
|
||||
* @author resurtm <resurtm@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
|
@ -12,6 +12,29 @@ use yii\base\InvalidConfigException;
|
||||
use yii\helpers\FileHelper;
|
||||
|
||||
/**
|
||||
* FileMutex implements mutex "lock" mechanism via local file system files.
|
||||
* This component relies on PHP `flock()` function.
|
||||
*
|
||||
* Application configuration example:
|
||||
*
|
||||
* ```
|
||||
* [
|
||||
* 'components' => [
|
||||
* 'mutex'=> [
|
||||
* 'class' => 'yii\mutex\FileMutex'
|
||||
* ],
|
||||
* ],
|
||||
* ]
|
||||
* ```
|
||||
*
|
||||
* Note: this component can maintain the locks only for the single web server,
|
||||
* it probably will not suffice to your in case you are using cloud server solution.
|
||||
*
|
||||
* Warning: due to `flock()` function nature this component is unreliable when
|
||||
* using a multithreaded server API like ISAPI.
|
||||
*
|
||||
* @see Mutex
|
||||
*
|
||||
* @author resurtm <resurtm@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
|
Binary file not shown.
@ -11,6 +11,26 @@ use Yii;
|
||||
use yii\base\InvalidConfigException;
|
||||
|
||||
/**
|
||||
* MysqlMutex implements mutex "lock" mechanism via MySQL locks.
|
||||
*
|
||||
* Application configuration example:
|
||||
*
|
||||
* ```
|
||||
* [
|
||||
* 'components' => [
|
||||
* 'db'=> [
|
||||
* 'class' => 'yii\db\Connection',
|
||||
* 'dsn' => 'mysql:host=127.0.0.1;dbname=demo',
|
||||
* ]
|
||||
* 'mutex'=> [
|
||||
* 'class' => 'yii\mutex\MysqlMutex',
|
||||
* ],
|
||||
* ],
|
||||
* ]
|
||||
* ```
|
||||
*
|
||||
* @see Mutex
|
||||
*
|
||||
* @author resurtm <resurtm@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
|
Reference in New Issue
Block a user