承接 iivannov/elegant-laravel-worker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

iivannov/elegant-laravel-worker

Composer 安装命令:

composer require iivannov/elegant-laravel-worker

包简介

Elegant way to gracefully handle SIGTERM signal in Laravel queue worker

README 文档

README

Elegant way to gracefully handle SIGTERM signal in Laravel 5.3 queue worker. In Laravel >=5.4 this issue is beautifully handled.

Install

Via Composer

$ composer require iivannov/elegant-laravel-worker

Register in Laravel

To replace the default Queue Worker with this one, you need to add the ElegantWorkerServiceProvider class to the providers array in your config\app.php

'providers' => [
    ...
    Iivannov\ElegantWorker\ElegantWorkerServiceProvider::class,
];

Use Case

Gracefully stop a Queue Worker by using SIGTERM signal.

Why would I stop the Worker?

There are many cases that will require to restart the worker.

  • start/stop workers when auto-scaling
  • temporarily stop the execution of tasks
  • reloading supervisor (or another monitoring tool) configuration

Default Laravel Behaviour:

When SIGTERM is received by the Worker it interrupts immediately the currently processed job, which may break your application by not letting the job finish leading to unexpected results.

Elegant Behaviour:

When SIGTERM is received by the Worker it will wait for the currently processed job to finish and then will exit gracefully.

What do we solve?

  • Interrupting long running jobs executing consecutive interrelated tasks
  • Interrupting in the middle of a DB transaction causing a deadlock
  • Prevent repeating the execution of a an interrupted job when it is picked up again by a Worker

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固