2017 © Pedro Peláez
 

library laraworker

LaraWorker is a helper package that makes integrating your Laravel application with Iron.io's IronWorker very easy!

image

iron-io/laraworker

LaraWorker is a helper package that makes integrating your Laravel application with Iron.io's IronWorker very easy!

  • Monday, July 6, 2015
  • by ironio
  • Repository
  • 20 Watchers
  • 42 Stars
  • 5,404 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

laraworker , (*1)

LaraWorker is a helper package that makes integrating your Laravel application with Iron.io's IronWorker very easy!, (*2)

IronWorker makes it super easy to add queuing and background processing to your Laravel applications., (*3)

Installation

  1. Run composer require iron-io/laraworker., (*4)

  2. Set Iron.io credentials in app/config/queue.php (or config/queue.php in Laravel 5.0 and higher) and set default to iron --> 'default' => 'iron',, (*5)

    To get your Iron.io credentials, signup for a free account at Iron.io., (*6)

  3. Install the IronWorker artisan commands for upload and run, (*7)

    php vendor/iron-io/laraworker/LaraWorker.php -i true, (*8)

    This script will also copy worker example ExampleLaraWorker.php to the workers directory in the root of your project., (*9)

Uploading Workers

IronWorker is a cloud service that runs your Laravel app and waits for jobs to be queued up., (*10)

To upload all workers:, (*11)

php artisan ironworker:upload --worker_name=* --exec_worker_file_name=*, (*12)

To upload a single worker:, (*13)

php artisan ironworker:upload --worker_name=ExampleLaraWorker --exec_worker_file_name=ExampleLaraWorker.php, (*14)

Queuing up jobs

From the console:, (*15)

php artisan ironworker:run --queue_name=ExampleLaraWorker, (*16)

From inside your laravel application, insert this code into your app:, (*17)

Queue::pushRaw("This is Hello World payload :)", 'ExampleLaraWorker'));, (*18)

To access the functionality of IronMQ PHP lib use IronMq class instead of Laravel Queue, (*19)

use Illuminate\Encryption\Encrypter;
....

$crypt = new Encrypter(Config::get('app.key'));

$ironmq = new \IronMQ(array(
    'token' => Config::get('queue.connections.iron.token', 'xxx'),
    'project_id' => Config::get('queue.connections.iron.project', 'xxx')
)); 
$ironmq->postMessages($queue_name, array(
        return $crypt->encrypt("This is Hello World payload_1"),
        return $crypt->encrypt("This is Hello World payload_2")
    )
);

License

This software is released under the BSD 2-Clause License. You can find the full text of this license under LICENSE.txt in the module's root directory., (*20)

The Versions

06/07 2015

dev-master

9999999-dev http://github.com/iron-io/laraworker

LaraWorker is a helper package that makes integrating your Laravel application with Iron.io's IronWorker very easy!

  Sources   Download

BSD 2-Clause License

The Requires

 

laravel task job background iron delayed_job iron_worker