From 0ad0534b22ec7c07a78d582257c6274952ebed52 Mon Sep 17 00:00:00 2001 From: Frederic Beckmann Date: Sun, 9 Feb 2025 02:04:50 +0100 Subject: [PATCH] Add method to send progress updates to caller Introduced a `SendProgressUpdate` method in `WeatherUpdateHub` to allow sending progress messages specifically to the calling client. This enhances client feedback during operations. --- Api/SignalR/WeatherUpdateHub.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Api/SignalR/WeatherUpdateHub.cs b/Api/SignalR/WeatherUpdateHub.cs index aeedd07..4c8e9d8 100644 --- a/Api/SignalR/WeatherUpdateHub.cs +++ b/Api/SignalR/WeatherUpdateHub.cs @@ -10,5 +10,11 @@ namespace Api.SignalR // Broadcast the message to all connected clients. await Clients.All.SendAsync("ReceiveMessage", user, message); } + + public async Task SendProgressUpdate(string message) + { + // Send a message to the caller. + await Clients.Caller.SendAsync("ProgressUpdate", message); + } } } \ No newline at end of file