Skip to content

Commit 4b3099d

Browse files
committed
Fixes for linux
1 parent 581ae85 commit 4b3099d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Terremoth/Async/File.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
use Exception;
66
use Symfony\Component\Process\Process as SymfonyProcess;
77

8-
class File
8+
readonly class File
99
{
1010
/**
1111
* @throws Exception
1212
*/
13-
public function __construct(private readonly string $file, private readonly array $args = [])
13+
public function __construct(private string $file, private array $args = [])
1414
{
1515
if (!is_readable($this->file)) {
1616
throw new Exception('File ' . $this->file . ' does not exists or is not readable!');
1717
}
1818
}
1919

20-
public function run(): int
20+
public function run(): void
2121
{
2222
$template = [PHP_BINARY, $this->file, ...$this->args, '&'];
2323

@@ -26,6 +26,6 @@ public function run(): int
2626
}
2727

2828
$process = new SymfonyProcess($template);
29-
return $process->start();
29+
$process->start();
3030
}
3131
}

src/Terremoth/Async/Process.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct()
2929
/**
3030
* @throws Exception
3131
*/
32-
public function send(Closure $asyncFunction): int
32+
public function send(Closure $asyncFunction): void
3333
{
3434
$serialized = serialize(new SerializableClosure($asyncFunction));
3535
$serializedLength = strlen($serialized);
@@ -49,6 +49,6 @@ public function send(Closure $asyncFunction): int
4949
$key = array_search('{length}', $this->processTemplate);
5050
$this->processTemplate[$key] = $serializedLength;
5151
$process = new SymfonyProcess($this->processTemplate);
52-
return $process->run();
52+
$process->start();
5353
}
5454
}

0 commit comments

Comments
 (0)