Skip to content

A Laravel queue connector to process the enqueued jobs at the end of the application

License

Notifications You must be signed in to change notification settings

jlorente/laravel-application-end-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Application End Queue

A Laravel queue connector to process the enqueued jobs at the end of the application.

This connector is very similar to the "sync" connector with the difference that jobs are executed at the end of the application instead of instantly.

It is useful for example when sending real time notifications to third party webhooks inside database transactions. With the "sync" connector, if the third party application webhook queries your API, as the transaction wouldn't have end, the third party application won't know the real state of the model. With this connector, the notification will be sent at the end of the application when all commits have been executed.

Installation

The preferred way to install this extension is through composer.

With Composer installed, you can then install the extension using the following commands:

$ php composer.phar require jlorente/laravel-application-end-queue

or add

...
    "require": {
        "jlorente/laravel-application-end-queue": "*"
    }

to the require section of your composer.json file.

Configuration

Register the ServiceProvider in your config/app.php service provider list.

config/app.php

return [
    //other stuff
    'providers' => [
        //other stuff
        Jlorente\Laravel\Queue\ApplicationEndQueueServiceProvider,
    ];
];

Then add the driver to the application config queue file.

config\queue.php

return [
    //other stuff
    'connections' => [
        //other stuff
        'application-end' => [
            'driver' => 'application-end',
        ],
    ],
];

Usage

See the Laravel documentation to learn how to use jobs and queues.

Remember that notifications can also be enqueued.

License

Copyright © 2019 José Lorente Martín [email protected].

Licensed under the BSD 3-Clause License. See LICENSE.txt for details.

About

A Laravel queue connector to process the enqueued jobs at the end of the application

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages