Example #1
0
 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();
 }
Example #2
0
 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();
     }
 }