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); } } })); }
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); } } })); }