Skip to content

Commit e927020

Browse files
committed
Remove unnecessary send adapter
In previous versions of the `channels` library, the `send()` method returned `bool` to indicate if the send was succesful or not. Recent versions use exception to report errors and return `None`, making the `send()` method directly compatible with what the resampler expects, so we don't need an adapter any more. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 5df1db5 commit e927020

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/frequenz/sdk/actor/_resampling.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ async def _subscribe(self, request: ComponentMetricRequest) -> None:
8787
Sample[Quantity], request_channel_name
8888
).new_sender()
8989

90-
async def sink_adapter(sample: Sample[Quantity]) -> None:
91-
await sender.send(sample)
92-
93-
self._resampler.add_timeseries(request_channel_name, receiver, sink_adapter)
90+
self._resampler.add_timeseries(request_channel_name, receiver, sender.send)
9491

9592
async def _process_resampling_requests(self) -> None:
9693
"""Process resampling data requests."""

0 commit comments

Comments
 (0)