src/Worker.php
public function send(string $payload = null, string $header = null)
    {
        if (is_null($header)) {
            $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE);
        } else {
            $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW);
        }

        $this->relay->send($payload, Relay::PAYLOAD_RAW);
    }
public function send(string $payload = null, string $header = null)
    {
        if (is_null($header)) {
            $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE);
        } else {
            $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW);
        }

        $this->relay->send($payload, Relay::PAYLOAD_RAW);
    }
public function send ( string $ payload = null , string $ header = null ) { if ( is_null ( $ header ) ) { $ this -> relay -> send ( $ header , Relay :: PAYLOAD_CONTROL | Relay :: PAYLOAD_NONE ) ; } else { $ this -> relay -> send ( $ header , Relay :: PAYLOAD_CONTROL | Relay :: PAYLOAD_RAW ) ; } $ this -> relay -> send ( $ payload , Relay :: PAYLOAD_RAW ) ; }
Respond to the server with result of task execution and execution context.

Example:
$worker->respond((string)$response->getBody(), json_encode($response->getHeaders()));

@param string|null $payload
@param string|null $header
Respond to the server with result of task execution and execution context .