nepada/message-bus-nette 问题修复 & 功能扩展

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

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

nepada/message-bus-nette

最新稳定版本:v2.4.3

Composer 安装命令:

composer require nepada/message-bus-nette

包简介

Integration of nepada/message-bus into Nette Framework.

README 文档

README

Build Status Coverage Status Downloads this Month Latest stable

Installation

Via Composer:

$ composer require nepada/message-bus-nette

Register the extension in config.neon:

extensions:
    messageBus: Nepada\MessageBusNette\DI\MessageBusExtension

Usage

See nepada/message-bus for the documentation of the core library.

Logging

The extension tries to autowire PSR compatible logger into logging middleware. If this doesn't work for you, specify the logger service in configuration explicitly:

messageBus:
    logger: @myLoggerService

Nested command handling

Nested command handling is not allowed by default, this can be changed in configuration:

messageBus:
    allowNestedCommandHandling: true

Doctrine

Doctrine ORM specific features for message bus are provided by nepada/message-bus-doctrine package. Follow the link for more detailed documentation. Once you install the package, it gets detected by DI extension and all necessary services are set up.

With Doctrine integration:

  • all commands are handled in a transaction and all changes are automatically flushed and commited after the handler successfully finishes, or rolled back on error,
  • database transactions started outside of command bus are forbidden,
  • entity manager is (optionally) cleared before and after the handling of every command.

Change or completely disable the default entity manager clearing logic:

messageBus:
    clearEntityManager
        onStart: false
        onSuccess: false
        onError: false

You can record your domain events inside entities implementing Nepada\Bridges\MessageBusDoctrine\Events\ContainsRecordedEvents and they will be automatically collected and dispatched on flush.

Tip: use SearchExtension to auto-register command handlers and event subscribers

search:
    messageBusHandlers:
        in: %appDir%
        implements:
            - Nepada\MessageBus\Commands\CommandHandler
            - Nepada\MessageBus\Events\EventSubscriber

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-07-22