1 parent 3812f16 commit a8ec47fCopy full SHA for a8ec47f
1 file changed
src/allocation/service_layer/unit_of_work.py
@@ -8,7 +8,6 @@
8
9
from allocation import config
10
from allocation.adapters import repository
11
-from . import messagebus
12
13
14
class AbstractUnitOfWork(abc.ABC):
@@ -22,13 +21,11 @@ def __exit__(self, *args):
22
21
23
def commit(self):
24
self._commit()
25
- self.publish_events()
26
27
- def publish_events(self):
+ def collect_new_events(self):
28
for product in self.products.seen:
29
while product.events:
30
- event = product.events.pop(0)
31
- messagebus.handle(event)
+ yield product.events.pop(0)
32
33
@abc.abstractmethod
34
def _commit(self):
0 commit comments