Asynchronous Operations

The examples presented so far have assumed that receive and peek operations are synchronous. The applications have issued method calls that might block if the requested message queue is empty. One key strength of message queuing solutions is that they’re designed for asynchronous operations, and blocking is a feature that should be designed out of any such systems. We’ll examine some of the issues involved in asynchronous operations next.

Receiving Messages Asynchronously

The receive and peek operations of the MessageQueue class support the asynchronous programming model used elsewhere in the .NET Framework Class Library. The BeginPeek and BeginReceive methods start a receive or peek operation asynchronously, using a thread ...

Get Microsoft® Visual J#™ .NET (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.