PHP code example of dmasior / querabilis

1. Go to this page and download the library: Download dmasior/querabilis 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/ */

    

dmasior / querabilis example snippets


use Initx\Querabilis\Driver\FilesystemQueue;

$queue = new FilesystemQueue('./queue');

use Initx\Querabilis\Envelope;

$envelope = new Envelope('Payload goes here');

$queue->add($envelope);

$envelope = $queue->remove();

$envelope->getPayload(); // "Payload goes here"

use Predis\Client;
use Initx\Querabilis\Driver\RedisQueue;

$client = new Client(['host' => '127.0.0.1']);
$queue = new RedisQueue($client, 'queueName');

use Aws\Sqs\SqsClient;
use Initx\Querabilis\Driver\SqsQueue;

$client = new SqsClient(your_sqs_client_config);
$queue = new SqsQueue($client, 'queueName');

use Initx\Querabilis\Driver\InMemoryQueue;

$queue = new InMemoryQueue();

use Pheanstalk\Pheanstalk;
use Initx\Querabilis\Driver\BeanstalkdQueue;

$client = Pheanstalk::create([your_beanstalkd_config]);
$queue = new BeanstalkdQueue($client);

use PhpAmqpLib\Connection\AMQPStreamConnection;
use Initx\Querabilis\Driver\AmqpQueue;

$connection = new AMQPStreamConnection([your_amqp_config]);
$queue = new AmqpQueue($connection, 'queueName', 'exchange');