1. Go to this page and download the library: Download bupy7/zf-queue library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bupy7 / zf-queue example snippets
// YourModule/src/task/ExampleTask.php
namespace YourModule\Task;
use Bupy7\Queue\Task\TaskInterface;
use Laminas\Stdlib\ParametersInterface;
use Chat\Service\ChatService;
class SendAccountTask implements TaskInterface
{
/**
* @var ChatService
*/
protected $chatService;
public function __construct(ChatService $chatService) {
$this->chatService = $chatService;
}
/**
* @param ParametersInterface $params
* - message (string)
* @return bool
*/
public function execute(ParametersInterface $params): bool
{
$this->chatService->send($params->get('message'));
return true;
}
}