diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-21 17:35:01 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-21 17:35:01 +0000 |
commit | ca7300a9aa7620317deeb2a51e5d7441bebccc5a (patch) | |
tree | 5b88ecdbbb4523303e203b408f95549f60bac253 /src | |
parent | 34cb7f64880bfed566c0f2405faf068cbba3b736 (diff) | |
parent | 3f1728907126e3fb009ae8652bdc4bb333f13f31 (diff) |
Merge #310
310: Replace multiple sys_calls with a combined one r=vvval a=vvval
Co-authored-by: Valentin V / vvval <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/Worker.php | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/Worker.php b/src/Worker.php index 74296801..d9de0fa9 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -83,26 +83,9 @@ class Worker */ public function send(string $payload = null, string $header = null): void { - if ($header === null) { - $this->relay->send('', Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE); - } else { - $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW); - } - - $this->relay->send((string)$payload, Relay::PAYLOAD_RAW); - } - - /** - * Respond to the server with result of task execution and execution context. Uses less amount of sys_calls. - * - * @param string|null $payload - * @param string|null $header - */ - public function sendPackage(string $payload = null, string $header = null): void - { $this->relay->sendPackage( (string)$header, - Relay::PAYLOAD_CONTROL | ($header ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW), + Relay::PAYLOAD_CONTROL | ($header === null ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW), (string)$payload, Relay::PAYLOAD_RAW ); |