jlorente/laravel-application-end-queue

A Laravel queue connector to process jobs at the end of the application
2,440 1
Install
composer require jlorente/laravel-application-end-queue
Latest Version:1.0.5
PHP:>=7.0.0
License:BSD-3-Clause
Last Updated:Feb 9, 2022
Links: GitHub  ·  Packagist
Maintainer: jlorente

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 jose.lorente.martin@gmail.com.

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

Related Packages

jlorente/laravel-transaction-commit-queue

A Laravel queue connector to process jobs after successful transactions commits

2,869 3
bebbolus/edmrabbitpackage

Rabbit Entity Management Package for Laravel PHP Framework

42 0
iivannov/elegant-laravel-worker

Elegant way to gracefully handle SIGTERM signal in Laravel queue worker

4,016 2
atehnix/laravel-vk-requester

Laravel package for Vk.com API

3,446 74
bigperson/laravel-vk-geo

Parse countries, regions and cities from vk.com api

440 14