admsa/larachet
Composer 安装命令:
composer require admsa/larachet
包简介
Laravel 5 and ratchet integration
README 文档
README
Laravel 5 and ratchet integration
Usage
Require composer
"admsa/larachet": "dev-master"
Add provider to your config/app.php
'providers' => [
// Existing providers
'Admsa\Larachet\LarachetServiceProvider',
]
Add facade alias to your config/app.php
'aliases' => [
// Existing aliases
'Larachet' => 'Admsa\Larachet\LarachetFacade'
]
$data = [];
Larachet::push('kittens-category', $data);
Javascript code usage
var r = new Larachet('ws://localhost:8080');
r.watch('kittens-category', function(topic, data) {
console.log('New article published to category "' + topic + '" : ' + JSON.stringify(data));
});
r.watch('puppy-category', function(topic, data) {
console.log('New article published to category "' + topic + '" : ' + JSON.stringify(data));
});
Note
This is still under development.
Javascript code is already loaded. Kindly check the html source code.
References
http://blog.alexandervn.nl/2012/05/03/install-zeromq-php-ubuntu
统计信息
- 总下载量: 212
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-10