visual-craft/work-queue-bundle 问题修复 & 功能扩展

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

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

visual-craft/work-queue-bundle

最新稳定版本:v0.6.0

Composer 安装命令:

composer require visual-craft/work-queue-bundle

包简介

Background jobs scheduling using Beanstalk (Symfony bundle)

README 文档

README

Background jobs using Beanstalk (Symfony bundle)

Install

$ composer require visual-craft/work-queue-bundle

Configure

##config/packages/visual_craft_work_queue.yaml

visual_craft_work_queue:
    connections:
        default: ~
    queues:
        test_queue:
            connection: default
            worker: 'App\BackgroundJob\Worker\TestWorker'

Create Worker

<?php

declare(strict_types=1);

namespace App\BackgroundJob\Worker;

use VisualCraft\WorkQueue\Worker\JobMetadata;
use VisualCraft\WorkQueue\Worker\WorkerInterface;

class TestWorker implements WorkerInterface
{
    public function work($payload, JobMetadata $metadata): void
    {
        //..
    }
}

Add service

services:
    App\Command\TestCommand:
        arguments:
            - '@visual_craft_work_queue.manager.test_queue'

Add queue

//..
private QueueManager $queueManager;

public function __construct(QueueManager $queueManager)
{
    $this->queueManager = $queueManager;
}

//..
    $this->queueManager->add('mixed payload');
//..

License

This code is released under the MIT license. See the complete license in the file: LICENSE

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-27