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:
39
stubs/testCacheMapBroker.php
Normal file
39
stubs/testCacheMapBroker.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mshallop
|
||||
* Date: 3/6/19
|
||||
* Time: 11:00 AM
|
||||
*/
|
||||
// load the namaste environment
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
// instantiate
|
||||
$meta = [
|
||||
META_TEMPLATE => TEMPLATE_CLASS_TEST_MONGO,
|
||||
META_CLIENT => CLIENT_CLIENT,
|
||||
META_CLIENT_IP => STRING_SESSION_HOME,
|
||||
META_EVENT_GUID => guid(), // simulate a broker event by generating the event guid
|
||||
];
|
||||
$errors = array();
|
||||
|
||||
$query = [
|
||||
CM_TST_FIELD_TEST_INT => [ OPERAND_NULL => [ OPERATOR_EQ => [ 4 ]]],
|
||||
CM_TST_FIELD_TEST_BOOL => [ OPERAND_NULL => [ OPERATOR_EQ => [ true ]]],
|
||||
OPERAND_AND => null
|
||||
];
|
||||
|
||||
$payload = [
|
||||
BROKER_REQUEST => BROKER_REQUEST_FETCH,
|
||||
BROKER_DATA => [ STRING_QUERY_DATA => $query ],
|
||||
BROKER_META_DATA => $meta
|
||||
];
|
||||
|
||||
$bc = new gacBrokerClient( BROKER_QUEUE_R, basename(__FILE__) . AT . __LINE__);
|
||||
if (!$bc->status) {
|
||||
exit(ERROR_BROKER_CLIENT_DECLARE . BROKER_QUEUE_R);
|
||||
}
|
||||
|
||||
$results = json_decode(gzuncompress($bc->call(gzcompress(json_encode($payload)))));
|
||||
|
||||
var_export($results);
|
||||
Reference in New Issue
Block a user