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

Skip to content

Commit 9716fe0

Browse files
committed
messagebus takes a uow [handle_takes_uow]
1 parent 0bc35ef commit 9716fe0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/allocation/service_layer/messagebus.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
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
5+
if TYPE_CHECKING:
6+
from allocation.service_layer import unit_of_work
47

58

6-
def handle(event: events.Event):
9+
def handle(event: events.Event, uow: unit_of_work.AbstractUnitOfWork):
710
for handler in HANDLERS[type(event)]:
8-
handler(event)
11+
handler(event, uow=uow)
912

1013

1114
HANDLERS = {

0 commit comments

Comments
 (0)