ghostwalker / jobber
Powerful, simple, message queue client
Fund package maintenance!
overtrue
Requires
- nette/robot-loader: ^3.4
- react/async: ^4.0
- react/promise: ~2.0
- react/socket: ^1.12
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.1
This package is auto-updated.
Last update: 2025-03-01 00:38:37 UTC
README
Welcome to Jobber 👋
Powerful, simple, message queue client
Install
composer require ghostwalker/jobber
Usage
Create bootServer.php file in your main directory You can also specify the address and port for the server and client, as well as specify the directory where your classes are stored
<?php /** * boot JobberServer Class */ use GhostWalker\Jobber\JobberServer; require_once __DIR__ . 'vendor/autoload.php'; JobberServer::$directory = __DIR__ . '/jobs'; JobberServer::$ipPort = '127.0.0.1:6969'; JobberServer::bootSystem();
Start server
php bootServer.php //To keep the process running permanently in the background,
you should use a process monitor such as Supervisor to ensure that the queue worker does not stop running.
create a class in the directory you specified and create a "__construct" method
with arguments that accepts an array of $date
<?php class test { protected array $data = []; public function __construct(array $data) { $this->data = $data //array(int(999)) } }
Create a client class and load a new task
<?php use \GhostWalker\Jobber\JobberClient; require __DIR__ . '/vendor/autoload.php'; JobberClient::$ipPort = '127.0.0.1:6969'; $jobber = new JobberClient(); $jobber->addTask(test::class, [999]); $jobber->addTask(test1::class, [123]);
Author
👤 GhostWalker
- Github: @GhostWalkers
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Work on
the application is based on ReactPhp, as well as a robot-loader for loading classes
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2022 GhostWalker.
This project is MIT licensed.
❤️ readme