Skip to content

Commit 9ba99ac

Browse files
committed
messagebus.handle now takes a UoW [handle_takes_uow]
1 parent fd79a8e commit 9ba99ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/allocation/messagebus.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
from __future__ import annotations
12
from typing import List, Dict, Callable, Type
23
from allocation import email, events, services, redis_pubsub
34

45

5-
def handle(events_: List[events.Event]):
6+
def handle(events_: List[events.Event], uow: unit_of_work.AbstractUnitOfWork):
67
while events_:
78
event = events_.pop(0)
89
for handler in HANDLERS[type(event)]:
9-
handler(event)
10+
handler(event, uow=uow)
1011

1112

1213
def send_out_of_stock_notification(

0 commit comments

Comments
 (0)