Commit 9e320daf by Klimov Paul

Doc comments for the 'mutex' classes extended

parent f1f158aa
......@@ -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
*/
......
......@@ -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
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment