public function handleMessage(ThreadCommunicator $communicator, $messagePayload)
    {
        $action = $messagePayload['action'];
        $parameters = $messagePayload['parameters'];

        if (method_exists($this, $action)) {
            return call_user_func_array(array($this, $action), $parameters);
        }

        return false;
    }
public function handleMessage(ThreadCommunicator $communicator, $messagePayload)
    {
        $action = $messagePayload['action'];
        $parameters = $messagePayload['parameters'];

        if (method_exists($this, $action)) {
            return call_user_func_array(array($this, $action), $parameters);
        }

        return false;
    }
public function handleMessage ( ThreadCommunicator $ communicator , $ messagePayload ) { $ action = $ messagePayload [ 'action' ] ; $ parameters = $ messagePayload [ 'parameters' ] ; if ( method_exists ( $ this , $ action ) ) { return call_user_func_array ( array ( $ this , $ action ) , $ parameters ) ; } return false ; }
Each message received call this function
@param ThreadCommunicator $communicator
@param mixed $messagePayload
@return mixed
Each message received call this function