php-mq / client
PHPMQ Client
dev-master
2018-01-01 21:54 UTC
Requires
- php: >=7.1
- php-mq/protocol: dev-master
- php-mq/stream: dev-master
Requires (Dev)
- roave/security-advisories: dev-master
- tm/tooly-composer-script: ^1.0
This package is auto-updated.
Last update: 2024-11-10 06:21:40 UTC
README
PHPMQ\Client
Description
The PHPMQ client to send, consume and acknowledge messages in interaction with the PHPMQ server.
Installation
composer require php-mq/client
Usage
Sending a message to the message queue server
<?php declare(strict_types=1); namespace YourVendor\YourProject; use PHPMQ\Client\Client; use PHPMQ\Client\Types\QueueName; use PHPMQ\Client\Sockets\ClientSocket; use PHPMQ\Client\Sockets\Types\NetworkSocket; $networkSocket = new NetworkSocket( '127.0.0.1', 9100 ); $clientSocket = new ClientSocket( $networkSocket ); $client = new Client( $clientSocket ); $client->sendMessage( new QueueName( 'Example-Queue' ), 'This is an example message.' ); $client->disconnect();
Contributing
Contributions are welcome and will be fully credited. Please see the contribution guide for details.