filsh/yii2-wamp Extension for WAMP(Web Application Messaging Protocol)

module

yii2-wamp-router

Installation

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"
    }
}

Examples

// 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();
            }
        );
});

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
3 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
91 total downloads