Handle the ability to block on the inpyut queue or the output queue.