Why method does not start on prefix ($session->subscribe('query.update.' ...)?
How can i run function on subscribe event only with some prefix?
I need to check the hash and decline the subscription if it is wrong.
public function onSessionStart($session, $transport)
{
$context = new \React\ZMQ\Context($this->getLoop());
$pull = $context->getSocket(\ZMQ::SOCKET_PULL);
$pull->bind('tcp://127.0.0.1:8081');
$pull->on('message', [$this, 'onBlogEntry']);
$session->subscribe('query.update.', function ($args, $argsKw, $details, $publicationId) {
$value = isset($args[0]) ? $args[0] : '';
echo 'Received ' . json_encode($value) . ' on topic ' . $details->topic . PHP_EOL;
},[ 'match' => 'prefix' ]);
}
var connection = new autobahn.Connection({
url: 'ws://********:8080',
realm: 'realm1',
authmethods: ['ipauth'] // Tell the router that we want to use the ipauth auth provider
});
function onevent(args) {
console.log("Event:", args[0]);
}
connection.onopen = function (session, details) {
var m = "Congrats " + details.authid + "! You're connected to the WAMP server!";
console.log(m);
session.subscribe('query.update.123',onevent);
};
connection.onclose = function (reason, details) {
console.log("Connection Closed: ", reason, details);
};
connection.open();
Why method does not start on prefix ($session->subscribe('query.update.' ...)?
How can i run function on subscribe event only with some prefix? I need to check the hash and decline the subscription if it is wrong.