Skip to content

Commit

Permalink
Merge pull request #170 from prooph/vido_and_overview
Browse files Browse the repository at this point in the history
Merge readme into overview and add live coding video
  • Loading branch information
codeliner authored Oct 21, 2017
2 parents 4e32b23 + 6a26ba1 commit a9727d2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ $commandBus->dispatch($echoText);
//Output should be: It works
```

## Live Coding Introduction

[![Prooph Service Bus v6](https://img.youtube.com/vi/6EcQjVSj3m4/0.jpg)](https://www.youtube.com/watch?v=6EcQjVSj3m4)

## Documentation

Documentation is [in the docs tree](docs/), and can be compiled using [bookdown](http://bookdown.io).
Expand Down
1 change: 0 additions & 1 deletion docs/bookdown.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"title": "Service Bus",
"content": [
{"intro": "../README.md"},
{"overview": "service_bus_system.md"},
{"message_bus": "message_bus.md"},
{"plugins": "plugins.md"},
Expand Down
51 changes: 50 additions & 1 deletion docs/service_bus_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,56 @@ prooph/service-bus acts as a messaging facade. It operates on the application la
In addition we also provide so-called "message producers" which connect prooph/service-bus
with messaging infrastructure on the system and network level.

Three different message bus implementations are available.
## Installation

```bash
composer require prooph/service-bus
```
## Quick Start

```php
<?php

use Prooph\ServiceBus\CommandBus;
use Prooph\ServiceBus\Example\Command\EchoText;
use Prooph\ServiceBus\Plugin\Router\CommandRouter;

$commandBus = new CommandBus();

$router = new CommandRouter();

//Register a callback as CommandHandler for the EchoText command
$router->route('Prooph\ServiceBus\Example\Command\EchoText')
->to(function (EchoText $aCommand): void {
echo $aCommand->getText();
});

//Expand command bus with the router plugin
$router->attachToMessageBus($commandBus);

//We create a new Command
$echoText = new EchoText('It works');

//... and dispatch it
$commandBus->dispatch($echoText);

//Output should be: It works
```

## Live Coding Introduction

[![Prooph Service Bus v6](https://img.youtube.com/vi/6EcQjVSj3m4/0.jpg)](https://www.youtube.com/watch?v=6EcQjVSj3m4)


## Messaging API

`prooph/service-bus` allows you to define the API of your model with the help of messages.

1. **Command** messages describe actions your model can handle.
2. **Event** messages describe things that happened while your model handled a command.
3. **Query** messages describe available information that can be fetched from your (read) model.

Three different message bus implementations are available, too.

## CommandBus

Expand Down

0 comments on commit a9727d2

Please sign in to comment.