定制 therezor/laravel-transactional-jobs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

therezor/laravel-transactional-jobs

最新稳定版本:1.1.6

Composer 安装命令:

composer require therezor/laravel-transactional-jobs

包简介

Submit laravel jobs inside transaction. Cancel job after rollback. Proceed after successful commit.

README 文档

README

Note

Laravel 10 and newer versions natively support transactional job handling without the need for this package.

Problem:

Solution:

By using this package you easily dispatch jobs inside transactions. Cancel job on transaction rollback. Add to queue on transaction committed.

Installation

This package requires PHP 7.1 and Laravel 5.8 or higher. If you are on a PHP version below 7.1 or a Laravel version below 5.8 just use an older version of this package.

  1. Run composer require therezor/laravel-transactional-jobs in your laravel project root folder

  2. Implement TheRezor\TransactionalJobs\Contracts\RunAfterTransaction to jobs that run in the middle of database transactions

<?php

use TheRezor\TransactionalJobs\Contracts\RunAfterTransaction;

class MySuperJob implements ShouldQueue, RunAfterTransaction
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    
    ...
}

统计信息

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

GitHub 信息

  • Stars: 44
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-26