mirror of https://github.com/deavmi/tasky.git
Engine
- If a `Request` is not expecting a response then do not call `dequeue()` on the `Queue` registered nor `process`byte[])` - Added a TODO comment
This commit is contained in:
parent
8387d0ee78
commit
a51df3b699
|
@ -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);
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
/* De-register the queue */
|
||||
tManager.releaseQueue(newQueue);
|
||||
|
|
Loading…
Reference in New Issue