Пример #1
0
 private static void ConcurrentSingleTransaction(List <TestUser> users)
 {
     foreach (var p in users)
     {
         Task.Delay(1000);
         SocketReceiver.Subscribe(p.Token);
         //Task.Delay(5000);
     }
     //Task.Delay(10000);
     Console.WriteLine("Subscription Completed!!!");
     //Parallel.ForEach(users, p =>
     //{
     foreach (var p in users)
     {
         var apiService = new ApiService(p.AuthToken);
         //Console.WriteLine(apiService.GetAllAwards());
         var response = apiService.RegisterWorkPattern();
         if (response != null)
         {
             TransactionManager.Record(response);
         }
     }
     //});
     //Task.Delay(5000);
 }
Пример #2
0
 private static void ConcurrentMultipleTransactionPerSocket(List <TestUser> users)
 {
     foreach (var p in users)
     {
         Task.Delay(1000);
         SocketReceiver.Subscribe(p.Token);
         //Task.Delay(5000);
     }
     Console.WriteLine("Subscription Completed!!!");
     foreach (var p in users)
     {
         var apiService = new ApiService(p.AuthToken);
         var response   = apiService.RegisterWorkPattern();
         if (response != null)
         {
             TransactionManager.Record(response);
         }
     }
     //});
     //Task.Delay(5000);
 }