madbob/laravel-queue-loopback 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

madbob/laravel-queue-loopback

Composer 安装命令:

composer require madbob/laravel-queue-loopback

包简介

Dummy Laravel queue driver to run jobs as detached HTTP requests.

README 文档

README

This is a dummy driver for Laravel's queue subsystem.

When you schedule a job through this queue, an HTTP request is sent to the application itself (on a dedicated route) and it will not wait for a response, so to let the job to be executed as a different detached state while you continue elaboration or even return a response to the user.

Useful to have actual asyncronous jobs without having to deal with worker processes, dedicated services, complex environments or whatever, but absolutely not reccomended for intensive scale.

Installation

composer require madbob/laravel-queue-loopback

In your .env file, set:

QUEUE_DRIVER=loopback

In your config/queue.php, add the following block among available connections:

'loopback' => [
    'driver' => 'loopback',

    /*
        The key is intended to protect the route used for internal execution, as
        it is still a public route and it is unprotected by the `auth`
        middleware or other native authentication methods.
    */
    'key' => 'put_here_a_random_key',
],

For advanced configuration you can execute php artisan vendor:publish --tag=config to obtain a new file in config/loopback-queue.php, where you can specify:

  • the middleware group to be used for the internal routing. By default it is an empty array (no middleware group); if you intend to specify one or more groups it is raccomended to define a new one not including the native VerifyCsrfToken middleware, as internal POSTs used to trigger the jobs would fail due the missing CSRF token

Usage

It works exactly as any other queue in Laravel: create your own Jobs and dispatch them as usual.

But, not as usual, you have not to execute any php artisan queue:work command or similar.

The loopback driver does not handles different queues nor priorities.

统计信息

  • 总下载量: 1.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固