summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin V / vvval <[email protected]>2020-04-21 20:30:15 +0300
committerValentin V / vvval <[email protected]>2020-04-21 20:30:15 +0300
commit3f1728907126e3fb009ae8652bdc4bb333f13f31 (patch)
tree5b88ecdbbb4523303e203b408f95549f60bac253 /src
parent3b04f1655eab65b5037f15064549bd3abae527ea (diff)
#305 Replace multiple sys_calls with a combined one
Diffstat (limited to 'src')
-rw-r--r--src/Worker.php19
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
);