Wrap synchronous code into async await in disconnected scenario
问题 I have the following client-server style pseudo-code: public void GetGrades() { var msg = new Message(...); // request in here QueueRequest?.Invoke(this, msg); // add to outgoing queue } In another processor class I have a loop : // check for messages back from server // server response could be a "wait", if so, wait for real response // raise MessageReceived event here // each message is then processed by classes which catch the event // send new messages to server if (queue.Any()){ var msg