https://github.com/utopia-php/queue
https://github.com/utopia-php/queue
hacktoberfest
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/utopia-php/queue
- Owner: utopia-php
- License: mit
- Created: 2022-03-21T23:00:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T10:59:43.000Z (3 months ago)
- Last Synced: 2025-03-27T22:11:10.611Z (2 months ago)
- Topics: hacktoberfest
- Language: PHP
- Homepage:
- Size: 257 KB
- Stars: 9
- Watchers: 6
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Utopia Queue
[](https://travis-ci.com/utopia-php/queue)

[](https://appwrite.io/discord)Utopia Queue is a powerful Queue library. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io).
Although this library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project it is dependency free and can be used as standalone with any other PHP project or framework.
## Getting Started
Install using composer:
```bash
composer require utopia-php/queue
```Init in your application:
```php
ping()) {
var_dump('Connection is ready.');
} else {
var_dump('Connection is not ready.');
}$adapter = new Queue\Adapter\Swoole($connection, 12, 'my-queue');
$server = new Queue\Server($adapter);$server
->job()
->inject('message')
->action(function (Message $message) {
var_dump($message);
});$server
->error()
->inject('error')
->action(function ($error) {
echo $error->getMessage() . PHP_EOL;
});$server
->workerStart()
->action(function () {
echo "Worker Started" . PHP_EOL;
});$server->start();
// Enqueue messages to the worker using the Redis adapter
$connection = new Redis('redis', 6379);
$client = new Client('my-queue', $connection);$client->enqueue([
'type' => 'test_number',
'value' => 123
]);
```## System Requirements
Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
## Copyright and license
The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)