• Stars
    star
    290
  • Rank 137,633 (Top 3 %)
  • Language
    PHP
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Laravel Async Queue Driver

Laravel 5 Async Queue Driver

Push a function/closure to the background.

For Laravel 5.4, check the 0.6 branch

For Laravel 5.3, check the 0.5 branch

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: This is using the DatabaseQueue, so make sure you set that up first, including migrations.

Install

Require the latest version of this package with Composer

composer require barryvdh/laravel-async-queue

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

Barryvdh\Queue\AsyncServiceProvider::class,

You need to create the migration table for queues and run it.

$ php artisan queue:table
$ php artisan migrate

You should now be able to use the async driver in config/queue.php. Use the same config as for the database, but use async as driver.

'connections' => array(
    ...
    'async' => array(
        'driver' => 'async',
        'table' => 'jobs',
        'queue' => 'default',
        'expire' => 60,
    ),
    ...
}

Set the default to async, either by changing to config or setting QUEUE_DRIVER in your .env file to async.

Note: By default, php is used as the binary path to PHP. You can change this by adding the binary option to the queue config. You can also add extra arguments (for HHVM for example)

'connections' => array(
    ...
    'async' => array(
        'driver' => 'async',
        'table' => 'jobs',
        'queue' => 'default',
        'expire' => 60,
        'binary' => 'php',
        'binary_args' => '',
    ),
    ...
}

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. For more info see http://laravel.com/docs/queues

More Repositories

1

laravel-debugbar

Debugbar for Laravel (Integrates PHP Debug Bar)
PHP
15,498
star
2

laravel-ide-helper

IDE Helper for Laravel
PHP
13,496
star
3

laravel-dompdf

A DOMPDF Wrapper for Laravel
PHP
6,091
star
4

laravel-snappy

Laravel Snappy PDF
PHP
2,447
star
5

laravel-translation-manager

Manage Laravel translation files
PHP
1,564
star
6

laravel-elfinder

elFinder bundle for Laravel
PHP
730
star
7

laravel-httpcache

Laravel HTTP Cache
PHP
459
star
8

laravel-migration-generator

Generate migrations based on existing tables
PHP
246
star
9

elfinder-flysystem-driver

elFinder driver for Flysystem
PHP
182
star
10

laravel-omnipay

Omnipay ServiceProvider for Laravel
PHP
169
star
11

laravel-vendor-cleanup

L4 Vendor Cleanup Command (DEPRECATED!)
PHP
162
star
12

composer-cleanup-plugin

Composer plugin for cleaning up unused files from packages.
PHP
143
star
13

laravel-form-bridge

Laravel Bridge for the Symfony Form Component
PHP
143
star
14

laravel-twigbridge

Laravel TwigBridge
PHP
59
star
15

laravel-security

Laravel Security
PHP
53
star
16

laravel-stack-middleware

Stack Middleware for Laravel
PHP
40
star
17

laravel-assetic

Assetic ServiceProvider for Laravel
PHP
37
star
18

barryvdh.github.io

Jekyll blog for barryvdh.nl
HTML
16
star
19

OAuth

PSR2 compliant OAuth 1.0 library based on Andy Smith's OAuth library here: http://oauth.googlecode.com/svn/code/php/
PHP
6
star
20

picofeed

Picofeed fork
PHP
4
star
21

elfinder-builds

Mirror from the nightly builds from elFinder
JavaScript
3
star
22

assetic-filters

Additional CSSminFilter and UriPrependFilter, using the mrclay/minify libraries
PHP
3
star
23

laravel-translatable

A Laravel package for multilingual models
PHP
1
star