Implements a message queue to support asynchronous algorithms.