Slight improvement of ClientHandler constructor.

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

By extracting the creation of the Streams event listener, the setStream
method becomes better readable.

It also adds a nice separation of responsibilities.

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

The ::onClientMessage() used an unnecessary elseif, because the previous
if-construction already returns.

Just making it a separate if improves the ease of understanding of this
method.

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

Some small coding-style changes to ::onWorkerHandlerMessage() to improve
readability.

Mainly changing concatenation of log messages into sprintf()s.

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

Add an early return in ClientHandler::onWorkerHandlerStatusMessage().

Also a few small CS changes.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
CS changes: ClientHandler::handleWorkerHandlerQueue()

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
CS changes: ClientHandler::hasExpiredWorkerHandler().

Added a little whitespace to improve logical separation withing the
method.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
ClientHandler: don't use storage ArrayAccess API.

By using the ::has() and ::get() methods of the Storage, the code become
slightly better understandable.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
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>
Merge pull request #29 from jacobkiers/refactor-client-handler

Refactor ClientHandler.