public async Task UpdateProgress(string sessionKey, int value, int total = -1, string stepId = "") { WebsocketSessionFileProgress response = new WebsocketSessionFileProgress { SessionKey = sessionKey, UnitsCompleted = value, UnitTotal = total, StepID = stepId }; WebsocketSessionUpdate[] updates = CreateProgressUpdates(WebsocketSessionUpdateStatus.Progress, response); WebsocketSession session = GetSessionByKey(sessionKey); string hostId = session.GetAttributeValue <string>("hostId"); WebsocketSessionMessageResponse updateResponse = CreateWebsocketResponseMessage(WebsocketSessionMessageType.StatusUpdates, updates); SendMessage(sessionKey, hostId, updateResponse); }
protected static WebsocketSessionUpdate[] CreateProgressUpdates(WebsocketSessionUpdateStatus status, WebsocketSessionFileProgress progress) { WebsocketSessionUpdate[] updates = new WebsocketSessionUpdate[] { new WebsocketSessionUpdate { Status = GetSessionUpdateStatusString(status), Progress = progress } }; return(updates); }