Componette

Componette

lukascellar

lukascellar / tactician 1.10

Nette extension for the Tactician - simple, flexible command bus library

download-cloud-line composer require cellar/tactician

Nette Tactician integration

Nette extension for the Tactician library https://github.com/thephpleague/tactician/

Installation

Step 1: Download Nette extension for Tactician

Open a command console, enter your project directory and execute the following command to download latest version:

$ composer require cellar/tactician

Step 2: Enable the extension

Open your application config file and add TacticianExtension:

extensions: 
    tactician: Cellar\Tactician\DI\TacticianExtension

Step 3: Configure middlewares

tactician:
    commandbus:
        default:
            middleware:
                - @tactician.middleware.queue
                - @tactician.middleware.locking
                - @tactician.middleware.command_handler

Important: Adding your own middleware is absolutely encouraged, just be sure to always add @tactician.middleware.command_handler as the final middleware. Otherwise, your commands won't actually be executed.

Check the Tactician docs for more info and a complete list of middleware.

Step 4: Add command handlers

services:
    myCommandHandler: 
        class: My\LaunchRocketHandler
        tags: 
            tactician.handler: [
                command: My\LaunchRocketCommand
            ]
bar-chart-fill

Statistics

download-cloud-fill
11372
star-fill
0
bug-fill
0
flashlight-fill
2y
price-tag-2-line

Badges

guide-fill

Dependencies

php (^7.1)
Componette Componette felix@nette.org