Skip to content

Commit 0cdd6b2

Browse files
committed
Add default value for maxsize parameter of new_receiver method
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 698a95f commit 0cdd6b2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/frequenz/sdk/timeseries/battery_pool/_methods.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from frequenz.channels import Broadcast, Receiver
1414

1515
from ..._internal._asyncio import cancel_and_await
16-
from ..._internal._constants import WAIT_FOR_COMPONENT_DATA_SEC
16+
from ..._internal._constants import RECEIVER_MAX_SIZE, WAIT_FOR_COMPONENT_DATA_SEC
1717
from ._component_metric_fetcher import (
1818
ComponentMetricFetcher,
1919
LatestBatteryMetricsFetcher,
@@ -37,7 +37,9 @@ def update_working_batteries(self, new_working_batteries: set[int]) -> None:
3737
"""
3838

3939
@abstractmethod
40-
def new_receiver(self, maxsize: int | None) -> Receiver[T | None]:
40+
def new_receiver(
41+
self, maxsize: int | None = RECEIVER_MAX_SIZE
42+
) -> Receiver[T | None]:
4143
"""Return new receiver for the aggregated metric results.
4244
4345
Args:
@@ -110,7 +112,9 @@ def name(cls) -> str:
110112
"""
111113
return "SendOnUpdate"
112114

113-
def new_receiver(self, maxsize: int | None) -> Receiver[T | None]:
115+
def new_receiver(
116+
self, maxsize: int | None = RECEIVER_MAX_SIZE
117+
) -> Receiver[T | None]:
114118
"""Return new receiver for the aggregated metric results.
115119
116120
Args:

0 commit comments

Comments
 (0)