Skip to content

Commit 7a1718e

Browse files
chore: add comment on public order book cache keys
Signed-off-by: Matthias Wende <[email protected]>
1 parent 3a4e61c commit 7a1718e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/frequenz/client/electricity_trading/_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,9 @@ def receive_public_order_book(
10591059
start_time_utc = dt_to_pb_timestamp_utc(start_time) if start_time else None
10601060
end_time_utc = dt_to_pb_timestamp_utc(end_time) if end_time else None
10611061

1062+
# We are caching requests to Enable Efficient Reuse and Resource Management.
1063+
# The following cache key contains all fields of a `ReceivePublicOrderBookStreamRequest`
1064+
# to ensure that the stream is unique for each combination of parameters.
10621065
cache_key = (
10631066
public_order_filter,
10641067
(start_time_utc.seconds, start_time_utc.nanos) if start_time_utc else None,

0 commit comments

Comments
 (0)