bbit/async-dispatcher-bundle

symfony BBITAsyncDispatcherBundle

安装量: 116,796

依赖者: 0

建议者: 0

安全性: 0

星标: 14

关注者: 2

分支: 8

开放问题: 0

类型:symfony-bundle

2.6 2016-12-22 11:52 UTC

This package is not auto-updated.

Last update: 2024-09-20 21:37:29 UTC


README

SensioLabsInsight knpbundles.com

Build Status Coverage Status

Latest Stable Version Total Downloads

AsyncDispatcherBundle 是一个简单的bundle,它为您提供异步事件分发器,该分发器将事件存储直到kernel.terminate,然后使用常规事件分发器触发它们。

步骤 1: 使用 composer 下载 BBITAsyncDispatcherBundle

在您的 composer.json 中添加 BBITAsyncDispatcherBundle:(使用最新稳定版,NOT dev-master)

{
    "require": {
        "bbit/async-dispatcher-bundle": "2.5.0",
    }
}

现在运行以下命令告诉 composer 下载该bundle

$ php composer.phar update bbit/async-dispatcher-bundle

Composer 将安装bundle到项目的 vendor/BBIT 目录。

步骤 2: 启用bundle

在kernel中启用bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new BBIT\AsyncDispatcherBundle\BBITAsyncDispatcherBundle(),
    );
}

用法

$dispatcher = $this->container->get('bbit_async_dispatcher.dispatcher'); // get dispatcher service
$dispatcher->addAsyncEvent('name_of_the.event', new CustomEvent($entity));

更多BBIT Bundles

SqsCommandQueueBundle 是一个简单的bundle,您可以使用它来在Amazon SQS上排队命令。然后可以由一个或多个工作进程异步处理这些命令。 Latest Stable Version