Skip to content

Commit ca7300a

Browse files
bors[bot]Valentin V / vvval
andauthored
Merge #310
310: Replace multiple sys_calls with a combined one r=vvval a=vvval Co-authored-by: Valentin V / vvval <[email protected]>
2 parents 34cb7f6 + 3f17289 commit ca7300a

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/Worker.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,10 @@ public function receive(&$header)
8282
* @param string|null $header
8383
*/
8484
public function send(string $payload = null, string $header = null): void
85-
{
86-
if ($header === null) {
87-
$this->relay->send('', Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE);
88-
} else {
89-
$this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW);
90-
}
91-
92-
$this->relay->send((string)$payload, Relay::PAYLOAD_RAW);
93-
}
94-
95-
/**
96-
* Respond to the server with result of task execution and execution context. Uses less amount of sys_calls.
97-
*
98-
* @param string|null $payload
99-
* @param string|null $header
100-
*/
101-
public function sendPackage(string $payload = null, string $header = null): void
10285
{
10386
$this->relay->sendPackage(
10487
(string)$header,
105-
Relay::PAYLOAD_CONTROL | ($header ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW),
88+
Relay::PAYLOAD_CONTROL | ($header === null ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW),
10689
(string)$payload,
10790
Relay::PAYLOAD_RAW
10891
);

0 commit comments

Comments
 (0)