Skip to content

Commit

Permalink
add in docs, unique queue what is it
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jun 23, 2017
1 parent c5c3b9c commit 1d4441b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/command/queue/pull_push/memory_unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Memory unique queue
It works just like the [Memory queue](memory.md), but it only allows storing unique commands. All duplicates will
be ignored.

### What is it for

A queue of unique commands is needed when you need to perform an action once after a domain event. But since there can
be many domain events, and the action must be performed only once, you need to remove all duplicate actions from the
queue.

Examples:

* **Action:** Update a block of popular articles
* **Event:** View article

Views come regularly, and the block needs to be updated no more often than 10 minutes. If there are no views, then
there is no need to update the block.

### Usage

```php
use GpsLab\Component\Command\Bus\HandlerLocatedCommandBus;
use GpsLab\Component\Command\Handler\Locator\DirectBindingCommandHandlerLocator;
Expand Down
16 changes: 16 additions & 0 deletions docs/command/queue/pull_push/predis_unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Predis unique queue
It works just like the [Predis queue](predis.md), but it only allows storing unique commands. All duplicates will
be ignored.

### What is it for

A queue of unique commands is needed when you need to perform an action once after a domain event. But since there can
be many domain events, and the action must be performed only once, you need to remove all duplicate actions from the
queue.

Examples:

* **Action:** Update a block of popular articles
* **Event:** View article

Views come regularly, and the block needs to be updated no more often than 10 minutes. If there are no views, then
there is no need to update the block.

### Usage

Configure queue:

```php
Expand Down

0 comments on commit 1d4441b

Please sign in to comment.