Exemple #1
0
 public void Run()
 {
     while (allReceived.Read() < msgCount)
     {
         try
         {
             Msg msg = sub.NextMessage(500);
             while (msg != null)
             {
                 received++;
                 allReceived.Increment();
                 datas.Add(Encoding.UTF8.GetString(msg.Data));
                 msg.Ack();
                 msg = sub.NextMessage(500);
             }
         }
         catch (NATSTimeoutException)
         {
             // timeout is acceptable, means no messages available.
         }
     }
 }
Exemple #2
0
 internal static long Next() => Generator.Increment();