1. Go to this page and download the library: Download kislayphp/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/ */
namespace Kislay\Queue;
class Server {
public function __construct(array $options = []);
public function listen(string $host, int $port): bool;
public function run(): void;
public function stop(): bool;
public function declare(string $queue, ?array $options = null): bool;
public function stats(?string $queue = null): array;
}
class Client {
public function __construct(string $baseUrl, array $options = []);
public function push(string $queue, mixed $payload, ?array $options = null): string;
public function pushBatch(string $queue, array $jobs): array;
public function stats(string $queue): array;
public function purge(string $queue): int;
}
class Worker {
public function __construct(string $baseUrl, array $options = []);
public function consume(string $queue, callable $handler, ?array $options = null): bool;
public function stop(): bool;
}
class Job {
public function id(): string;
public function queue(): string;
public function payload(): mixed;
public function headers(): array;
public function attempts(): int;
public function maxAttempts(): int;
public function availableAt(): int;
public function ack(): bool;
public function nack(?bool $requeue = true, ?int $delayMs = null): bool;
public function release(?int $delayMs = null): bool;
}