/// <summary> /// Calls the WriteProgress client method when a subtask progress event occurs. /// </summary> public static void WriteProgress(string machineName, string agentName, SnProgressRecord progressRecord) { SnTrace.TaskManagement.Write("TaskMonitorHub WriteProgress: {0}, taskId: {1}, agent: {2}", progressRecord.Progress.OverallProgress, progressRecord.TaskId, agentName); var hubContext = GlobalHost.ConnectionManager.GetHubContext <TaskMonitorHub>(); // Send progress to clients with the same app id only. Monitor clients are // registered to the appropriate group in the OnConnected event handler. hubContext.Clients.Group(progressRecord.AppId).WriteProgress(progressRecord); }
public void WriteProgress(string machineName, string agentName, SnProgressRecord progressRecord) { SnTrace.TaskManagement.Write("AgentHub WriteProgress. agent:{0}, progress:{1}", agentName, progressRecord); try { TaskMonitorHub.WriteProgress(machineName, agentName, progressRecord); } catch (Exception ex) { SnLog.WriteException(ex, "AgentHub WriteProgress failed.", EventId.TaskManagement.General); } }
public async Task WriteProgress(string machineName, string agentName, SnProgressRecord progressRecord) { SnTrace.TaskManagement.Write("AgentHub WriteProgress. agent:{0}, progress:{1}", agentName, progressRecord); try { await _monitorHub.WriteProgress(machineName, agentName, progressRecord).ConfigureAwait(false); } catch (Exception ex) { SnLog.WriteException(ex, "AgentHub WriteProgress failed.", EventId.TaskManagement.General); } }
/// <summary> /// Calls the WriteProgress client method when a subtask progress event occurs. /// </summary> public static async Task WriteProgress(this IHubContext <TaskMonitorHub> hubContext, string machineName, string agentName, SnProgressRecord progressRecord) { try { // Send progress to clients with the same app id only. Monitor clients are // registered to the appropriate group in the OnConnected event handler. await hubContext.Clients.Group(progressRecord.AppId).SendAsync("writeProgress", progressRecord) .ConfigureAwait(false); } catch (Exception ex) { SnLog.WriteException(ex, "TaskMonitorHub WriteProgress failed.", EventId.TaskManagement.General); } }
/// <summary> /// Calls the WriteProgress client method when a subtask progress event occurs. /// </summary> public void WriteProgress(SnProgressRecord progressRecord) { SnTrace.System.Write("SNTaskMonitorHub WriteProgress: {0}, taskId: {1}", progressRecord.Progress.OverallProgress, progressRecord.TaskId); Clients.Group(progressRecord.AppId).WriteProgress(progressRecord); }