Example #1
0
 Task RecieveMessage(IUserClient user)
 {
     return(Task.Run(() =>
     {
         Object receiveLock = new Object();
         lock (receiveLock)
         {
             if (user.CheckIfConnected())
             {
                 Message message = user.Recieve();
                 logger.Log(message.Body);
                 messages.Enqueue(message);
             }
         }
     }));
 }