Skip to content

Commit 541ab52

Browse files
committed
messagebus takes a uow [handle_takes_uow]
1 parent ed224de commit 541ab52

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/allocation/service_layer/messagebus.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
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.domain import events
34
from . import handlers
45

6+
if TYPE_CHECKING:
7+
from allocation.service_layer import unit_of_work
58

6-
def handle(event: events.Event):
9+
10+
def handle(
11+
event: events.Event,
12+
uow: unit_of_work.AbstractUnitOfWork,
13+
):
714
for handler in HANDLERS[type(event)]:
8-
handler(event)
15+
handler(event, uow=uow)
916

1017

1118
HANDLERS = {

0 commit comments

Comments
 (0)