Skip to content

Commit 09d69a4

Browse files
committed
new helpers to update read model [redis_readmodel_client]
1 parent 337fae5 commit 09d69a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/allocation/adapters/redis_eventpublisher.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@
1414
def publish(channel, event: events.Event):
1515
logging.debug("publishing: channel=%s, event=%s", channel, event)
1616
r.publish(channel, json.dumps(asdict(event)))
17+
18+
19+
def update_readmodel(orderid, sku, batchref):
20+
r.hset(orderid, sku, batchref)
21+
22+
23+
def get_readmodel(orderid):
24+
return r.hgetall(orderid)

0 commit comments

Comments
 (0)