GithubHelp home page GithubHelp logo

yii2_fecshop_queue's Introduction


Latest Stable Version Total Downloads Latest Unstable Version

Fecshop 队列扩展

Fecshop queue 功能部分,用于扩展一些队列的功能,将一些比较耗时的操作 拆出来放到队列中,异步解耦, 目前做的功能为:邮件发送。

安装

composer require --prefer-dist fancyecommerce/fecshop_queue 

or 在根目录的composer.json中添加

"fancyecommerce/fecshop_queue": "~1.0.4"

然后执行

composer update

配置文件

将@vendor\fancyecommerce\fecshop_queue\config\fecshop_queue.php 复制到 @common\config\fecshop_third_extensions\fecshop_queue.php(需要创建该文件)

该文件是扩展的配置文件,通过上面的操作,加入到fecshop的插件配置中。

使用

1.配置完成后,就可以使用MQ了,监听命令

1.1守护进程监听(响应快,但会长时间占用php进程)

yii queue/listen [timeout]  // [timeout]:number of seconds to wait a job. 

1.2cron方式监听,可以设置每分钟执行一次(响应有一定的延迟,但不会长时间占用php进程)

yii queue/run

关于redis消费消息的更多信息参看:yii2 redis queue

2.队列软件

默配置的是redis队列,你可以使用下面的几种队列软件来实现队列消息 yii2 queue driver

3.使用Supervisor,启动管理多个监听进程

详细参看:Supervisor

4.关于重试规则

当一段时间没有执行完成,或者执行失败,队列会安排重试, 在queue组件中配置,

    'queue' => [
        'ttr' => 5 * 60, // Max time for anything job handling 
        'attempts' => 3, // Max number of attempts
    ],

更多详细参看:queue重试规则

yii2_fecshop_queue's People

Contributors

fancyecommerce avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.