vanilla/queue-interop 问题修复 & 功能扩展

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

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

vanilla/queue-interop

Composer 安装命令:

composer require vanilla/queue-interop

包简介

Queue interop.

README 文档

README

This package provides abstraction and interfaces necessary for both job payloads and job processors to interact together.

From a job payload perspective

All job payloads must implement the RunnableJobInterface. A job processor will then call the following methods in order:

  • RunnableJobInterface::setup()
  • RunnableJobInterface::run()
  • RunnableJobInterface::teardown()

Beside this, all open source Vanilla jobs must extend the AbstractJob class so that jobs can be run directly on web server but also anywhere else by implementing a custom job processor.

Services

Services are made accessible to job payloads. But in order to access them, a job must implement the proper aware interface. By implementing the aware interface, a job processor will inject the corresponding service thru a setter method prior to running the payload.

Here's the list of services available:

Database

A job can implement DatabaseAwareInterface to get injected with the Garden\Db\Db object.

Vanilla configs and locales context

A job can implement VanillaContextAwareInterface to get injected with the VanillaContextInterface interface.
With VanillaContextInterface, a job can access a ConfigInterface to manage both configs and locales in Vanilla.

Scheduler

A job can implement SchedulerAwareInterface to get injected with the SchedulerInterface. With SchedulerInterface, a job can also schedule other jobs from within its payload.

From a job runner perspective

A job processor is responsible to provide implementation for the following interfaces:

  • JobBridgeInterface
  • JobContextInterface
  • SchedulerInterface
  • VanillaContextInterface
  • ConfigInterface

It is also responsible to inject services to jobs that implements the following interfaces:

  • DatabaseAwareInterface
  • SchedulerAwareInterface
  • VanillaContextAwareInterface

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固