Giter Site home page Giter Site logo

laravel-async-queue's Introduction

Laravel 4 Async Queue Driver

Push a function/closure to the background.

Just like the 'sync' driver, this is not a real queue driver. It is always fired immediatly. The only difference is that the closure is sent to the background without waiting for the response. This package is more usable as an alternative for running incidental tasks in the background, without setting up a 'real' queue driver.

Note: If you are coming from 0.1.0 (or dev-master), you will need to run the migrations, since the new versions uses a database to store the queue.

Install

Add the package to the require section of your composer.json and run composer update

"barryvdh/laravel-async-queue": "0.2.x"

Add the Service Provider to the providers array in config/app.php

'Barryvdh\Queue\AsyncServiceProvider',

You need to run the migrations for this package

$ php artisan migrate --package="barryvdh/laravel-async-queue"

Or publish them, so they are copied to your regular migrations

$ php artisan migrate:publish barryvdh/laravel-async-queue

You should now be able to use the async driver in config/queue.php

'default' => 'async',

'connections' => array(
    ...
    'async' => array(
        'driver' => 'async',
    ),
    ...
}

It should work the same as the sync driver, so no need to run a queue listener. Downside is that you cannot actually queue or plan things. Queue::later() is also fired directly, but just runs sleep($delay) in background.. For more info see http://laravel.com/docs/queues

laravel-async-queue's People

Contributors

barryvdh avatar davelip avatar

Watchers

LoreLLo avatar James Cloos avatar  avatar Andrea Cappelli avatar Felice Pizzurro avatar Lorenzo Cocchi avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.