Refactored the result processor thread to use a queue rather than trying to reinvent the wheel