Refactor ClientHandler::clientRequest().

Mainly a lot of early returns and some restructuring.

The ExecuteResponse is now sent as soon as the Request Id is known.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Refactor ClientHandler::clientFetch().

Mostly improved log messages and early returns.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Refactor ClientHandler::sendResponseToClients().

The most important part of this change is extracting the poison status
check. That improves readability a lot.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Improve ClientHandler::handleExpiredWorkerHandlers().

Mainly readability improvements, and a better log message.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Add and use Request::get/setWorkerHandlerId().

The functions were called Request::get/setWorker(), but in actuality
these didn't set the worker, but the ID of the Worker Handler.

Made the old functions proxy the new ones, and deprecated them.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Bugfix: Client\Request does not have ::hasResult.

The Request::hasResult property does not exits. Instead, it is called
::hasResponse.

Because of this, the result of method Request::hasResponse() is never
'true'. This potenially results in having to request the result over and
over again.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
Instantly send result to client if it is available.

If the ClientHandler knows the result for the request that the Client
wants to execute, it now sends it back immediately.

This improves efficiency, but slightly changes the (nondocumented)
contract between the Client and the ClientHandler. It does not change
the actual behaviour of the Client, though.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>