摘要: swoole 协程通道 为了协程直接互相通讯传递数据 和go的通道很相似 Co\run(function(){ $chan = new Swoole\Coroutine\Channel(1); Swoole\Coroutine::create(function () use ($chan) { fo 阅读全文
posted @ 2020-07-19 22:10 brady-wang 阅读(722) 评论(0) 推荐(0) 编辑
摘要: 启动命令 php bin/swoft http:start 或者 swoftctl run -c http:start 1 入口文件 bin/swoft.php #!/usr/bin/env php <?php // Bootstrap require_once __DIR__ . '/bootst 阅读全文
posted @ 2020-07-19 11:15 brady-wang 阅读(719) 评论(0) 推荐(0) 编辑
摘要: 可以借助Swoft下的Bean类操作容器 示例: 将类绑定至容器 use Swoft\Bean\Annotation\Bean; /** * @Bean("imageLogic") */ class ImageLogic extends BaseLogic { /** * 根据id获取图片 * @p 阅读全文
posted @ 2020-07-19 10:53 brady-wang 阅读(356) 评论(0) 推荐(2) 编辑