-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2c6029
commit 8fa3b1e
Showing
6 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
# py-bondi | ||
A library for creating event driven systems using domain driven design. | ||
|
||
In process... | ||
### Installation | ||
|
||
```bash | ||
pip install pybondi | ||
``` | ||
|
||
### Introduction | ||
|
||
This library provides a framework for modeling complex domains using an event driven architecture and the pub/sub pattern. It provides: | ||
|
||
- An in memory message bus for handling events and commands. | ||
- A simple in memory publisher for publishing messages to external systems. | ||
- A base aggregate root that can collect domain events and a base aggregate class. | ||
- A base repository class for storing and retrieving aggregates. | ||
- A session class for managing transactions and unit of work. | ||
- Default events for handling aggregate's state when it is added to a session, saved, or rolled back. | ||
|
||
Soon I will be updating this README with a more detailed explanation of how to use the library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from pybondi.messagebus import Messagebus | ||
from pybondi.events import Added, Saved | ||
from pybondi.events import Added, Commited | ||
|
||
messagebus = Messagebus() | ||
|
||
@messagebus.on(Added, Saved) | ||
@messagebus.subscribe(Added, Commited) | ||
def handle_events(event): | ||
pass | ||
|
||
def test_messagebus(): | ||
assert messagebus.event_handlers[Added][0] == handle_events | ||
assert messagebus.event_handlers[Saved][0] == handle_events | ||
assert messagebus.event_handlers[Commited][0] == handle_events |