PHP Класс malkusch\lock\mutex\MutexConcurrencyTest

If you want to run integration tests you should provide these environment variables: - MEMCACHE_HOST - REDIS_URIS - a comma separated list of redis:// URIs. - MYSQL_DSN, MYSQL_USER - PGSQL_DSN, PGSQL_USER
См. также: Mutex
Автор: Markus Malkusch ([email protected])
Наследование: extends PHPUnit_Framework_TestCase
Показать файл Открыть проект

Открытые методы

Метод Описание
provideMutexFactories ( ) : callable[][] Provides Mutex factories.
provideTestHighContention ( ) : array Returns test cases for testHighContention().
testHighContention ( callable $code, callable $mutexFactory ) Tests high contention empirically.
testSerialisation ( callable $mutexFactory ) Tests that two processes run sequentially.

Приватные методы

Метод Описание
fork ( integer $concurrency, callable $code ) Forks, runs code in the children and wait until all finished.
getPDO ( string $dsn, string $user ) : PDO Gets a PDO instance.

Описание методов

provideMutexFactories() публичный Метод

Provides Mutex factories.
public provideMutexFactories ( ) : callable[][]
Результат callable[][] The mutex factories.

provideTestHighContention() публичный Метод

Returns test cases for testHighContention().
public provideTestHighContention ( ) : array
Результат array The test cases.

testHighContention() публичный Метод

Tests high contention empirically.
public testHighContention ( callable $code, callable $mutexFactory )
$code callable The counter code.
$mutexFactory callable The mutex factory.

testSerialisation() публичный Метод

Tests that two processes run sequentially.
public testSerialisation ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.