Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
25
stubs/testCacheSmash.php
Normal file
25
stubs/testCacheSmash.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* testCacheSmash.php
|
||||
*
|
||||
* Test Stub for check the cacheMash() and smashCache() methods and returns from both method
|
||||
*
|
||||
*/
|
||||
|
||||
// initialization
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
$tokens = null;
|
||||
$errors = [];
|
||||
$maxKeys = mt_rand(100, 200);
|
||||
for ($index = 0; $index < $maxKeys; $index++)
|
||||
$tokens[] = [ guid() => 'this is a test'];
|
||||
|
||||
// call multi-cache to cache
|
||||
$keyList = gasCache::cacheMash($tokens, NUMBER_CACHE_DEFAULT, $errors);
|
||||
if (is_null($keyList)) exit ('cache mash failed');
|
||||
|
||||
// call cache-smash to remove records
|
||||
if (!gasCache::smashCache($keyList, $errors)) exit('smash cache failed');
|
||||
|
||||
$x = 1;
|
||||
Reference in New Issue
Block a user