private void StartStream <THub>(SampleStream stream, IHubContext <THub> hubContext) where THub : Hub { stream.Queue.ContentAdded += (a, b) => { hubContext.Clients.All.InvokeAsync("send", b); }; stream.StartAsync(); }
public async Task StartStreamAsync() { try { if (this.SampleStream.StreamState != StreamState.Running) { StartTime = DateTime.Now; NumberOfTotalTweetsPerSession = 0; SampleStream.StartAsync(); } } catch (Exception ex) { Logger.LogError(ex, "Error occurred during stream processing", null); StopStream(); } }