It is recommended that you install the Gearman library through composer. To do so, add the following lines to your composer.json
file.
{
"require": {
"filsh/yii2-wamp": "dev-master"
}
}
// configure component
'components' => [
'wampRouter' => [
'class' => 'filsh\wamp\components\WampRouter',
'realm' => 'realm',
'host' => '172.17.0.20',
'port' => '8000',
],
'wamp' => [
'class' => 'filsh\wamp\Module',
'wampRouter' => 'wampRouter',
'runnerMap' => [
...
]
]
],
// run examples
Yii::$app->wampRouter->connect(function(Connection $connection, ClientSession $session) {
$session->call('com.myapp.add2', [2, 3])
->then(function (CallResult $result) use($connection) {
echo $result;
$connection->close();
},
function (ErrorMessage $error) use($connection) {
echo $error;
$connection->close();
}
);
});
No stable releases.
Comments