PHP code example of ryunosuke / hellowo

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

    

ryunosuke / hellowo example snippets

bash
cat << 'EOS' > $RUNSCRIPT

ker([
    'work'   => function (ryunosuke\hellowo\Message $message) {
        file_put_contents('/var/log/hellowo/receive.log', "$message\n", FILE_APPEND | LOCK_EX);
    },
    'driver' => new ryunosuke\hellowo\Driver\MySqlDriver([
        'waittime'  => 30.0,
        'waitmode' => 'sql',
        'mysql'      => [
            'host'     => '127.0.0.1',
            'user'     => 'root',
            'password' => 'password',
            'database' => 'test',
        ],
        // job table name
        'table'    => 't_job',
    ]),
]);
$worker->start();
EOS