Issue running AsyncFacade run function
andreinocenti opened this issue · 0 comments
andreinocenti commented
Hi,
I'm using your package version 4.0.0 with Laravel 10. I followed the instructions for installation of the package and I have both PCNTL and POSIX extensions installed.
I runned the eg. code below
for ($i = 1; $i < 20; $i++) {
AsyncFacade::run(function () use ($i) {
sleep(1);
return $i;
});
}
And I got this error:
Declaration of VXM\Async\Runtime\ParentRuntime::createProcess($task, ?int $outputLength = null, ?string $binary = 'php'): Spatie\Async\Process\Runnable must be compatible with Spatie\Async\Runtime\ParentRuntime::createProcess($task, ?int $outputLength = null, ?string $binary = 'php', ?int $max_input_size = 100000): Spatie\Async\Process\Runnable
at vendor/vxm/laravel-async/src/Runtime/ParentRuntime.php:24
20▕ * @since 1.0.0
21▕ */
22▕ class ParentRuntime extends BaseParentRuntime
23▕ {
➜ 24▕ public static function createProcess($task, ?int $outputLength = null, ?string $binary = 'php'): Runnable
25▕ {
26▕ $runnable = parent::createProcess($task, $outputLength, $binary);
27▕
28▕ if ($runnable instanceof SynchronousProcess) {