Unclaimed project
Are you a maintainer of bunny? Claim this project to take control of your public changelog and roadmap.
Claim this projectChangelog
bunny
Performant pure-PHP AMQP (RabbitMQ) sync/async (ReactPHP) library
amqpamqp-clientamqp0-9-1phpphp-libraryrabbitmq
Last updated 24 days ago
v0.6.0-alpha.1 - bunny Release Notes | AnnounceHQBack to changelogImproved
v0.6.0-alpha.1
Non-Breaking Changes:
- Merged clients into one
- Marked
Client and Channel final through doc block and introduced interfaces for them for unit testing
- Dropped build in event loop, socket, and stream handling switching to
react/event-loop, react/socket, and for that
More PHP Projects
SecLists
SecLists is the security tester's companion. It's a collection of multiple types of lists used during security assessments, collected in one place. List types include usernames, passwords, URLs, sensitive data patterns, fuzzing payloads, web shells, and many more.
72.3k PHPcoolify
An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.
59.0k PHPreact/stream
Partially introduced strict typing and (return) type hints due to all the changes in the codeUpdated certain generated traits into generated classesEnsured performance didn't regress with these changesUpdated all examples, tutorials, and the benchmark. Dropping the async variants due to the mergeIntroduced Configuration object deprecating using an array for client configuration
- Raised minimum PHP version to 8.1+ unlocking the use of fibers
- Swapped
react/promise v2 with v3
- Dropped Event Loop injection and replaced it with the global loop accessor
<?php
-use Bunny\Async\Client;
+use Bunny\Client;
-use React\EventLoop\Factory;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
-$loop = Factory::create();
-(new Client($loop))->connect();
+$client = new Client();
-$loop->run();
- Merged
Async and Sync clients into Client utilizing fibers through react/async
Sync
<?php
use Bunny\Channel;
use Bunny\Client;
use Bunny\Message;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
-$client = (new Client())->connect();
+$client = new Client();
$channel = $client->channel();
$channel->queueDeclare('hello', false, false, false, false);
echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
-$channel->run(
+$channel->consume(
function (Message $message, Channel $channel) {
echo " [x] Received ", $message->content, "\n";
},
'hello',
'',
false,
true,
);
<?php
use Bunny\Client;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
-$client = (new Client())->connect();
+$client = new Client();
$channel = $client->channel();
$channel->queueDeclare('hello', false, false, false, false);
$channel->close();
$channel->publish('Hello World!', [], '', 'hello');
echo " [x] Sent 'Hello World!'\n";
$channel->close();
$client->disconnect();
Async
<?php
use Bunny\Channel;
-use Bunny\Async\Client;
+use Bunny\Client;
use Bunny\Message;
-use React\EventLoop\Factory;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
-$loop = Factory::create();
-(new Client($loop))->connect()
+$client = new Client();
-->then(function (Client $client) {
- return $client->channel();
-})
+$channel = $client->channel();
-->then(function (Channel $channel) {
- return $channel->queueDeclare('hello', false, false, false, false)->then(function () use ($channel) {
- return $channel;
- });
-})
+$channel->queueDeclare('hello', false, false, false, false);
-->then(function (Channel $channel) {
- echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
- $channel->consume(
- function (Message $message, Channel $channel, Client $client) {
- echo " [x] Received ", $message->content, "\n";
- },
- 'hello',
- '',
- false,
- true
- );
-});
+echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
+$channel->consume(
+ function (Message $message, Channel $channel) {
+ echo " [x] Received ", $message->content, "\n";
+ },
+ 'hello',
+ '',
+ false,
+ true,
+);
-$loop->run();
<?php
-use Bunny\Channel;
-use Bunny\Async\Client;
+use Bunny\Client;
-use React\EventLoop\Factory;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
-$loop = Factory::create();
-(new Client($loop))->connect()
+$client = new Client();
-->then(function (Client $client) {
- return $client->channel();
-})
+$channel = $client->channel();
-->then(function (Channel $channel) {
- return $channel->queueDeclare('hello', false, false, false, false)->then(function () use ($channel) {
- return $channel;
- });
-})
+$channel->queueDeclare('hello', false, false, false, false);
-->then(function (Channel $channel) {
- echo " [x] Sending 'Hello World!'\n";
- return $channel->publish('Hello World!', [], '', 'hello')->then(function () use ($channel) {
- return $channel;
- });
-})
+$channel->publish('Hello World!', [], '', 'hello');
-->then(function (Channel $channel) {
- echo " [x] Sent 'Hello World!'\n";
- $client = $channel->getClient();
- return $channel->close()->then(function () use ($client) {
- return $client;
- });
-})
+echo " [x] Sent 'Hello World!'\n";
+$channel->close();
-->then(function (Client $client) {
- $client->disconnect();
-});
+$client->disconnect();
- Channel::queueBind arguments
string $queue and string $exchange switched argument locations
<?php
use Bunny\Channel;
use Bunny\Client;
use Bunny\Message;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
$client = new Client();
$channel = $client->channel();
$channel->exchangeDeclare('logs', 'fanout');
$queue = $channel->queueDeclare('', false, false, true, false);
-$channel->queueBind($queue->queue, 'logs');
+$channel->queueBind('logs', $queue->queue);
- Total issues resolved: 1
- Total pull requests resolved: 32
- Total contributors: 5
enhancement
bug
feature
bug,enhancement
enhancement,feature
server
☁️ Nextcloud server, a safe home for all your data
PHP