damejidlo / message-bus
Installs: 61 025
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 8
Forks: 1
Open Issues: 2
Requires
- php: >=7.2
- psr/log: ^1.1
Requires (Dev)
- damejidlo/coding-standard: ^0.10.0
- jakub-onderka/php-parallel-lint: ^1.0
- mockery/mockery: ^1.2
- nette/tester: ^2.2
- phpstan/phpstan: ^0.11.5
- phpstan/phpstan-mockery: ^0.11
- phpstan/phpstan-shim: ^0.11.5
README
Abandoned
Use fork at https://github.com/ondrejbouda/message-bus or very similar library https://github.com/nepada/message-bus .
What is this
Message bus is a library (or a collection of libraries) used by Dáme jídlo for separating different layers and contexts within it's monolithic backend application.
In Dáme jídlo the main purpose was to
- create an application layer with commands/handlers (e.g. "place order") to separate domain logic from the rest of the application
- get rid of tight coupling of different contexts by using asynchronous event subscribers for secondary tasks (e.g. send notification to customer on order placed)
The core is a general message bus. It can be used in different ways:
- as a command bus, handling commands synchronously
- as a event dispatching system, with the ability to plug-in asynchronous ways to handle events in different subscribers
The message bus functionality can be enhanced with middleware, e.g.:
- logging
- transaction management
- sync/async handling
Documentation
Pending :) See tests/Integration
for basic use case examples.