2017 © Pedro Peláez
 

library laravel-external-queue

Use Laravel queues for sending messages between distributed systems

image

kristianedlund/laravel-external-queue

Use Laravel queues for sending messages between distributed systems

  • Sunday, August 30, 2015
  • by kristianedlund
  • Repository
  • 1 Watchers
  • 2 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

Laravel External Queues

Laravel queues are an awesome thing to use internally in an application in order to manage asynchronous tasks. However, in the usecase where you want external components such as desktop applications or other web applications to communicate with Laravel through queues it becomes somewhat more messy, since there is quite a bit of information embedded in a queue message about the internal workings, such as class names., (*1)

This package is an attempt to let applications communicate through queues by using a string as the job name, and then letting the internals of Laravel translate handle the execution., (*2)

If you don't need to send queue messages outside of your laravel application, then you don't need this package. The default works excellent., (*3)

Installation

Pull this package in through Composer., (*4)

{
    "require": {
        "kristianedlund/laravel-external-queue": "1.0"
    }
}
$ composer update

Add the package to your application service providers in config/app.php, (*5)

'providers' => [

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...

    'Kristianedlund\LaravelExternalQueue\ExternalQueueServiceProvider',

],

Publish the package config file to your application., (*6)

$ php artisan vendor:publish

Usage

Configuration

First of all you set up an external queue in the normal queue config file in laravel. It should look like, (*7)

'externalsqs' => [
    'driver' => 'externalsqs',
    'key'    => 'your-public-key',
    'secret' => 'your-secret-key',
    'queue'  => 'your-queue-url',
    'region' => 'us-east-1',
],

Second part is that you set up the different job names and map them to handler classes in the "externalqueue" config file., (*8)

Handler files

Last but not least you need to write the handler files., (*9)

They need to implement the handler contract Kristianedlund\LaravelExternalQueue\Contracts\ExternalQueueJobHandler and could look like, (*10)

<?php

namespace App\Handlers\ExternalJobs;

use Kristianedlund\LaravelExternalQueue\Contracts\ExternalQueueJobHandler as HandlerContract;
use Illuminate\Queue\Jobs\Job;

class TestJob implements HandlerContract
{
    public function handle(Job $job, $data = null)
    {
        // Do you job handling here
    }
}

License

The Laravel External Queue is open-sourced software licensed under the MIT license., (*11)

The Versions

30/08 2015

dev-master

9999999-dev

Use Laravel queues for sending messages between distributed systems

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristian Edlund

laravel queue sqs

30/08 2015

v1.1

1.1.0.0

Use Laravel queues for sending messages between distributed systems

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristian Edlund

laravel queue sqs

02/04 2015

v1.0

1.0.0.0

Use Laravel queues for sending messages between distributed systems

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristian Edlund

laravel queue sqs

02/04 2015

v0.1

0.1.0.0

Use Laravel queues for sending messages between distributed systems

  Sources   Download

MIT

The Requires

 

by Kristian Edlund