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
파일 보기 프로젝트 열기: malkusch/lock

공개 메소드들

메소드 설명
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.