PHP code example of ngorder / q

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

    

ngorder / q example snippets


\Ngorder\Q\Facades\NgorderQ::publish('test.route', [
            'message' => 'Hello World'
 ]);

\Ngorder\Q\Facades\NgorderQ::delay(2)->publish('test.route', [
            'message' => 'Hello World'
 ]);

    protected $routing = [
        'hello.*' => [MyConsumer::class, 'handleWildcard'],
        'test.key' => [AnotherConsumer::class, 'handleIt'],
        'another.key' => [
            [MultiConsumer::class, 'fun1'],
            [MultiConsumer::class, 'fun2']                        
        ]         
    ];

    protected $routing = [
        'some.key' => ThisIsInvokable::class,
    ];
bash
php artisan q:install