Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b2000e

Browse files
committed
Uow no longer puts events directly on the bus [uow_collect_new_events]
1 parent 75ee8c6 commit 4b2000e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/allocation/service_layer/unit_of_work.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
from allocation import config
1010
from allocation.adapters import repository
11-
from . import messagebus
12-
1311

1412

1513
class AbstractUnitOfWork(abc.ABC):
@@ -23,13 +21,11 @@ def __exit__(self, *args):
2321

2422
def commit(self):
2523
self._commit()
26-
self.publish_events()
2724

28-
def publish_events(self):
25+
def collect_new_events(self):
2926
for product in self.products.seen:
3027
while product.events:
31-
event = product.events.pop(0)
32-
messagebus.handle(event)
28+
yield product.events.pop(0)
3329

3430
@abc.abstractmethod
3531
def _commit(self):

0 commit comments

Comments
 (0)