PHP code example of eo / subway

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

    

eo / subway example snippets


$ php composer.phar update eo/subway



use Subway\Job;

class MyAwesomeJob extends Job
{
    public function perform()
    {
        // do something here
    }
}




use Predis\Client;
use Subway\Factory;

$redis  = new Client();
$subway = new Factory($redis);

$message = new Message('default', 'Subway\Tests\Job\Md5Job', array('hello' => 'world'));
$id = $this->factory->enqueue($message);

echo "Job $id enqueued!";

php subway.phar worker

php subway.phar worker -h