Skip to content

Commit 5fec3af

Browse files
committed
messagebus takes a uow [handle_takes_uow]
1 parent bb56062 commit 5fec3af

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/allocation/messagebus.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
from typing import List, Dict, Callable, Type
1+
from __future__ import annotations
2+
from typing import List, Dict, Callable, Type, TYPE_CHECKING
23
from allocation import events, handlers
4+
if TYPE_CHECKING:
5+
from allocation import unit_of_work
36

47

5-
def handle(event: events.Event):
8+
def handle(event: events.Event, uow: unit_of_work.AbstractUnitOfWork):
69
for handler in HANDLERS[type(event)]:
7-
handler(event)
10+
handler(event, uow=uow)
811

912

1013
HANDLERS = {

0 commit comments

Comments
 (0)