psamatt/service-bus-lite

Service Bus for PHP

Installs: 431

Dependents: 1

Stars: 9

Watchers: 1

Language: PHP

1.2 2014-09-04 06:44 UTC

README

Service Bus Lite is a PHP implementation of the popular NServiceBus in C#, you can find more information about a Service Bus on Wikipedia. This has been written with the influence of the popular ShortBus library in C#.

 Introduction

The idea of a service bus in a MVC Architecture is essentially a messaging queue that sits between the application logic (Controller) and your business logic (Domain). Upon firing requests at the message bus in the form of a Query or a Command, a matching Handler will be found and executed.

Your Handler will do your logic dependant on the type of request:

  • Query - A query is your read layer and will request information such as fetching all users who are from a specific country. This should be a layer that talks to your persistance or cache layer and should NEVER do write actions.

  • Command - A command is your write layer and will send information to your application such as creating records in your persistance layer, writing to logs etc.

How do I get started?

Using Composer, add the following into your composer.json

{
    "require": {
        psamatt/service-bus-lite": "dev-master"
    }
}

Now tell composer to download the bundle by running the following command:

$ php composer.phar update psamatt/service-bus-lite

Examples

To find how to use this library, check the examples.

Integrated into...

This library has been integrated into the following PHP Frameworks:

If you have integrated this into an unlisted Framework, then get in touch.