当前位置: 首页 > news >正文

郑州做网站茂睿科技wordpress本地上传服务器

郑州做网站茂睿科技,wordpress本地上传服务器,广州营销型网站建设哪家好,wordpress 页面和文章概述 workerman/rabbitmq 是一个异步RabbitMQ客户端#xff0c;使用AMQP协议。 RabbitMQ是一个基于AMQP#xff08;高级消息队列协议#xff09;实现的开源消息组件#xff0c;它主要用于在分布式系统中存储和转发消息。RabbitMQ由高性能、高可用以及高扩展性出名的Erlan…概述 workerman/rabbitmq 是一个异步RabbitMQ客户端使用AMQP协议。 RabbitMQ是一个基于AMQP高级消息队列协议实现的开源消息组件它主要用于在分布式系统中存储和转发消息。RabbitMQ由高性能、高可用以及高扩展性出名的Erlang语言写成具有高度的可靠性和可扩展性。它支持多种消息协议包括AMQP、STOMP、MQTT等并广泛应用于消息队列、消息中间件等领域。 RabbitMQ允许应用程序通过消息传递进行通信这使得不同的应用程序可以在不同的语言和操作系统之间进行通信。 RabbitMQ的消息工作机制涉及消息从发送端到接收端的流转过程。在这个过程中消息首先被发送到交换机Exchange然后交换机根据路由规则将消息路由到一个或多个队列Queue中。消费者Consumer从队列中获取消息并进行处理。 生产者和消费者 安装 composer require workerman/rabbitmq消费者 receive.php ?phpdeclare(strict_types1);use Bunny\Channel; use Bunny\Message; use Workerman\Worker; use Workerman\RabbitMQ\Client;require_once __DIR__ . /vendor/autoload.php;$worker  new Worker(); $worker-eventLoop  \Workerman\Events\Revolt::class;$worker-onWorkerStart  function() {// Create RabbitMQ Client$client  Client::factory([host  127.0.0.1,port  5672,user  guest,password  guest,vhost  /,heartbeat  60,heartbeat_callback  function () {echo  [-] coroutine-consumer-heartbeat\n;},interval  [100, 300]])-connect();$channel  $client-channel();$channel-queueDeclare(hello-coroutine);// Consumer$channel-consume(function (Message $message, Channel $channel, \Bunny\AbstractClient $client) {echo  [] Received , $message-content, \n;},hello-coroutine,,false,true);$client-run();echo  [*] Waiting for messages. To exit press CTRLC, \n;// Producer\Workerman\Timer::add($interval  5 , function () use ($channel) {$channel-publish($message  Hello World By Self Timer.  . time(), [], , hello-coroutine);echo  [] Sent $message\n;});echo  [!] Producer timer created, interval: $interval s.\n;}; Worker::runAll();运行命令 php receive.php start基于 Workerman 发布 send.php ?phpdeclare(strict_types1);use Workerman\RabbitMQ\Client; use Workerman\Worker;require_once __DIR__ . /vendor/autoload.php;$worker  new Worker(); $worker-eventLoop  \Workerman\Events\Revolt::class;$worker-onWorkerStart  function() {$client  Client::factory([host  host.docker.internal,port  5672,user  guest,password  guest,vhost  /,heartbeat  60,heartbeat_callback  function () {echo coroutine-producer-heartbeat\n;}])-connect();$channel  $client-channel();$channel-queueDeclare(hello-coroutine);// 每5秒发一个消息\Workerman\Timer::add(5, function () use ($channel) {$channel-publish($message  Hello World By Workerman Env Producer.  . time(), [], , hello-coroutine);echo  [x] Sent $message\n;}); }; Worker::runAll();运行命令 php send.php start基于 PHP-FPM 发布 script.php ?phpdeclare(strict_types1);use Workerman\RabbitMQ\Client;require_once __DIR__ . /vendor/autoload.php;$client  Client::factory([host  host.docker.internal,port  5672,user  guest,password  guest,vhost  /,heartbeat  60,heartbeat_callback  function () {echo coroutine-producer-heartbeat\n;} ])-connect(); $channel  $client-channel(); $channel-queueDeclare(hello-coroutine); $res  $channel-publish($message  Hello World By Normal Producer.  . time(), [], , hello-coroutine);echo  [x] Sent $message, success: $res\n;运行命令 php script.php异步消费者 receive.php ?phpuse Bunny\Channel; use Bunny\Message; use Workerman\Worker; use Workerman\RabbitMQ\Client;require __DIR__ . /vendor/autoload.php;$worker  new Worker();$worker-onWorkerStart  function() {(new Client())-connect()-then(function (Client $client) {return $client-channel();})-then(function (Channel $channel) {return $channel-queueDeclare(hello, false, false, false, false)-then(function () use ($channel) {return $channel;});})-then(function (Channel $channel) {echo  [*] Waiting for messages. To exit press CTRLC, \n;$channel-consume(function (Message $message, Channel $channel, Client $client) {echo  [x] Received , $message-content, \n;},hello,,false,true);}); }; Worker::runAll();运行命令 php receive.php start异步生产者 send.php ?php use Bunny\Channel; use Bunny\Message; use Workerman\Worker; use Workerman\RabbitMQ\Client;require __DIR__ . /vendor/autoload.php;$worker  new Worker();$worker-onWorkerStart  function() {(new Client())-connect()-then(function (Client $client) {return $client-channel();})-then(function (Channel $channel) {return $channel-queueDeclare(hello, false, false, false, false)-then(function () use ($channel) {return $channel;});})-then(function (Channel $channel) {echo  [x] Sending Hello World!\n;return $channel-publish(Hello World!, [], , hello)-then(function () use ($channel) {return $channel;});})-then(function (Channel $channel) {echo  [x] Sent Hello World!\n;$client  $channel-getClient();return $channel-close()-then(function () use ($client) {return $client;});})-then(function (Client $client) {$client-disconnect();}); }; Worker::runAll();运行命令 php send.php start
http://www.w-s-a.com/news/514365/

相关文章:

  • 东莞网站建设教程南京做代账会计在哪个网站上找
  • 网站开发好了 怎么发布wordpress数据库缓存插件
  • 工业电商网站怎么配色社交网站建设平台
  • 使用pycharm网站开发建一个网站需要什么条件
  • 网站建设哪些是需要外援的问题wordpress商品展示主题
  • 定制网站开发的目的是什么wordpress 增加按钮
  • 建设单位网站经费请示wordpress模板添加授权
  • 国外的电商网站有哪些为进一步加强校园网站建设
  • 专业集团门户网站建设企业微信商城和网站建设
  • 多少钱可以做网站找网络公司做推广费用
  • python php 网站开发网络营销师是干什么的
  • 网站建设设计方案动漫制作专业学校
  • 吴江区建设用地申报网站包装设计模板设计素材
  • 快速建站的公司wordpress 元数据定义
  • 网站seo分析工具网站标题用空格 逗号影响seo
  • 基金项目实验室信息网站建设wordpress文章新窗口打开
  • php网站开发就业前景做网站推荐源创网络
  • wordpress 8211西安网站优化维护
  • 泰安招聘网站有哪些wordpress 回复提醒
  • 网站服务器不稳定怎么打开网页企业营销策划心得体会
  • 自己做视频网站会不会追究版权企业商城网站建设方案
  • 烟台网站制作计划网站做seo的好处
  • 网站首页轮播官方网站下载拼多多
  • 罗庄区建设局网站自己做网站推广产品
  • 优秀flash网站欣赏苏州吴中区建设局网站
  • 网站添加wordpress博客网上商城购物系统论文
  • 上海市建设安全协会网站王夑晟企业网站建设需要做些什么
  • 网站app 开发辽宁建设工程信息网官网新网站是哪个
  • 厦门建设企业网站建设wordpress添加形式
  • 建立什么网站可以赚钱室内设计效果图qq群