PHP code example of fivesqrd / ordin

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

    

fivesqrd / ordin example snippets




return [
    'table' => 'My-Table-Name',
    'aws' => [
        'version' => 'latest',
        'region'  => 'eu-west-1',
        'credentials' => [
            'key'    => 'my-key',
            'secret' => 'my-secret',
        ],
    ],
];

php vendor/fivesqrd/ordin/scripts/CreateTable.php config.php

/* Receive 5 events */
$events = $queue->receive($observer)->limit(5)->fetch();

foreach ($events as $event) {

    $payload = $event->payload();

    /* Do the work */
    $id = $event->id();
}

/* Receive 5 events */
$events = $queue->receive($observer)->topics(['order.released'])->fetch(5);

foreach ($events as $event) {

    $payload = $event->payload();

    /* Do the work */
    $id = $event->id();
}

/* Receive 5 events */
$events = $queue->receive($observer)->topics(['order.released'])->fetch(5);

foreach ($events as $event) {

    $queue->unread($event, $observer);
}