2017 © Pedro Peláez
 

library domain-event

Help apps to be more domain event friendly

image

rezzza/domain-event

Help apps to be more domain event friendly

  • Wednesday, January 4, 2017
  • by tyx
  • Repository
  • 4 Watchers
  • 6 Stars
  • 208 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Library to help our apps to be domain event friendly without using EventStore at first., (*1)

Build Status, (*2)

Why ?

Because we did not find any library that deal with events in an asynchronous way without EventStore. And domain events are helpful even without EventStore, to start defining boundaries between your bounded contexts., (*3)

Supported event buses

  • Symfony Event dispatcher : sync
  • Redis : async

Example

See detailled quickstart, (*4)

To run example, (*5)

php examples/redis-worker.php
php examples/quickstart.php

In a fullstack way the best option is to track change in your repository, (*6)

class ORMBookingRepository extends ORMAggregateRootRepository implements BookingRepository
{
    public function find($bookingId)
    {
        $this->getInternalRepository->find($bookingId)
    }

    public function save(Booking $booking)
    {
        $this->getManager()->persist($booking);
        $this->getManager()->flush();
        $this->track($booking);
    }
}

$repository = new ORMBookingRepository(
    new ManagerRegistry,
    'My\FQCN\Booking',
    new ChangeTracker(
        new LoggerEventBus(
            $logger,
            new CompositeEventBus([
                new SymfonyEventBus($eventDispatcher),
                new RedisEventBus($redis, 'booking')
            ])
        )
    )
);

EventDispatcher debug

To debug your own event dispatcher with Symfony, we add a CLI for you. You should register it as a service and use the --service-id option., (*7)

The Versions

04/01 2017

dev-master

9999999-dev

Help apps to be more domain event friendly

  Sources   Download

MIT

The Requires

 

The Development Requires

by ReZzZa Team

17/03 2016

v0.1

0.1.0.0

Help apps to be more domain event friendly

  Sources   Download

MIT

The Requires

 

The Development Requires

by ReZzZa Team