pnixx/amp-rabbitmq 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pnixx/amp-rabbitmq

最新稳定版本:2.0.0

Composer 安装命令:

composer require pnixx/amp-rabbitmq

包简介

Async AMQP client

README 文档

README

Latest Version on Packagist Software License Total Downloads

This library is a pure asynchronous PHP implementation of the AMQP 0-9-1 protocol.

Code is mostly based on bunnyphp and PHPinnacle Ridge, but use amphp for async operations.

Install

Via Composer

$ composer require pnixx/amp-rabbitmq

Basic Usage

<?php

use Amp\Loop;
use PHPinnacle\Ridge\Channel;
use PHPinnacle\Ridge\Client;
use PHPinnacle\Ridge\Message;
use Revolt\EventLoop;

require __DIR__ . '/vendor/autoload.php';

$client = Client::create('amqp://user:pass@localhost:5672');

$client->connect();

$channel = $client->channel();

$queue = $channel->queueDeclare('queue_name');

for ($i = 0; $i < 10; $i++) {
    $channel->publish("test_$i", '', 'queue_name');
}

$channel->consume(function (Message $message, Channel $channel) {
    echo $message->content() . \PHP_EOL;

    $channel->ack($message);
}, 'queue_name');

EventLoop::run();

More examples can be found in examples directory.

Testing

$ composer tests

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email dev@phpinnacle.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-16