diff --git a/source/tasky/engine.d b/source/tasky/engine.d index 2558474..9ee3fda 100644 --- a/source/tasky/engine.d +++ b/source/tasky/engine.d @@ -14,6 +14,8 @@ public class Engine // TODO: Continue working on this + // TODO: Allow registering ResponseAnonymous with handlers etc + /** * Takes a request and sends it through to the endpoint * afterwhich we block for a response and when we get one @@ -35,11 +37,16 @@ public class Engine /* Send the message */ tManager.sendMessage(tReq); - /* Await for a response */ - byte[] resp = newQueue.dequeue().getPayload(); + /* Does this Request expect a response? */ + // TODO: We need not register the queue even if this is the case + if(req.expectsResponse()) + { + /* Await for a response */ + byte[] resp = newQueue.dequeue().getPayload(); - /* Run the response handler with the response */ - req.process(resp); + /* Run the response handler with the response */ + req.process(resp); + } /* De-register the queue */ tManager.releaseQueue(newQueue);