Skip to content

Commit

Permalink
completed the README file
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-san committed Mar 15, 2016
1 parent be34cf9 commit 74ca165
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,24 @@
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/remi-san/transaction-manager.svg?style=flat-square)](https://scrutinizer-ci.com/g/remi-san/transaction-manager/code-structure)

A simple transaction manager with a naive implementation.

It provides a common interface to manage transactions.

If you want to make a class transactional, implement the `Transactional` interface.

Transaction Manager
-------------------
Two `TransactionManager` implementations are provided allowing you to manage multiple `Transactional` classes in the same logic transaction.

- `SimpleTransactionManager` is a naive implementation preventing from beginning a transaction more than once.
- `MultipleTransactionManager` allows you to begin the transaction more than once but only commits if `commit` is called the same number of times as `beginTransaction`.

Implementations
---------------
Some `Transactional` implementations are provided:

- `TransactionalQueuePublisher` to publish in an AMQP queue with [`Burrow`](https://github.com/Evaneos/Burrow) in a transaction
- `DoctrineDbalTransactionManager` to deal with [`Doctrine DBAL`](https://github.com/doctrine/dbal) transactions
- `DoctrineEntityManager` to deal with [`Doctrine ORM`](https://github.com/doctrine/doctrine2) transactions
- `TransactionalEmitter` to emit `Events` with the [`PHP League` lib](https://github.com/thephpleague/event) in a transaction

1 change: 0 additions & 1 deletion src/Amqp/TransactionalQueuePublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function publish($data, $routingKey = '')
*/
public function beginTransaction()
{
$this->messages = [];
$this->running = true;
}

Expand Down
1 change: 0 additions & 1 deletion src/Event/TransactionalEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private function addEvent($event)
*/
public function beginTransaction()
{
$this->events = [];
$this->running = true;
}

Expand Down

0 comments on commit 74ca165

Please sign in to comment.