psamatt / service-bus-lite
Service Bus for PHP
Installs: 4 470
Dependents: 1
Suggesters: 0
Security: 0
Stars: 12
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.2
Requires (Dev)
- phpunit/phpunit: ~3
This package is not auto-updated.
Last update: 2024-12-31 03:27: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:
- Symfony2 using ServiceBusLiteBundle
If you have integrated this into an unlisted Framework, then get in touch.