Comments (5)
框架暂时没有封装 swoole 的协程客户端,客户端 swoole 官方提供的本来就高度封装,大家可以直接使用。
from mix.
后续版本可能我会增加
from mix.
好的,辛苦大佬。
另外,协程池这个,如何使用,我是要作为
消息队列(MQ)消费处理(发送邮件、短信)
这种用途,能给一个简单的发邮件的例子吗
比如消费rabbitmq或者redis的简单demo
刚接触这个框架,不是很明白使用。
from mix.
官网有这个demo的链接:Mix PHP V2 实例:协程池异步邮件发送守护程序 https://www.jianshu.com/p/ea635ad7fa9d
from mix.
https://www.kancloud.cn/onanying/mixphp2/1002219
go(function () {
$cli = new \Swoole\Coroutine\http\Client("127.0.0.1", 9502);
$ret = $cli->upgrade("/websocket");
if ($ret) {
$cli->push('{"method":"join.room","params":{"roomid":1010},"id":1}');
while (true) {
$data = $cli->recv();
if ($data === false) {
echo "disconnect" . PHP_EOL;
break;
}
var_dump($data);
}
}
});
from mix.
Related Issues (20)
- Redis-subscribe 支持 prefix 否? HOT 1
- 没有对mysql保留关键字做反引号处理 HOT 1
- 2.2版本 UDP服务器会重复执行处理接收到的数据 HOT 2
- 官网无法访问 HOT 2
- 数据量较多时,json_decode可能会失败 HOT 7
- PDO执行使用问号占位符的原生SQL报错 HOT 2
- 建议项目遵从语义化版本来维护版本号 HOT 1
- PHP用ip curl post请求 会卡1秒 HOT 5
- 新版本性能严重下降 HOT 6
- table方法传入表名order报错 HOT 1
- 验证器场景设置optional未生效 HOT 3
- Coroutine中同时使用Channel和Database pool导致出错 HOT 5
- mix-skeleton使用context()->get('guzzle') 报错 HOT 1
- php8RC3-swoole4.5.6 运行出错 HOT 1
- or and 查找抛出异常 HOT 1
- Upgrade to Zipkin 2.0 HOT 1
- log组件报错 HOT 1
- 推送模式卡死 HOT 1
- 如何正确的提交 PR
- V3 启动事务后 lastInsertId 值不正确 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mix.