Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running AsyncFacade run function #43

Open
andreinocenti opened this issue Sep 21, 2023 · 0 comments
Open

Issue running AsyncFacade run function #43

andreinocenti opened this issue Sep 21, 2023 · 0 comments

Comments

@andreinocenti
Copy link

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▕  */
     22class ParentRuntime extends BaseParentRuntime
     23▕ {
  ➜  24public static function createProcess($task, ?int $outputLength = null, ?string $binary = 'php'): Runnable
     25▕     {
     26$runnable = parent::createProcess($task, $outputLength, $binary);
     2728if ($runnable instanceof SynchronousProcess) {
peteradeojo added a commit to peteradeojo/laravel-async that referenced this issue Sep 27, 2023
peteradeojo added a commit to peteradeojo/laravel-async that referenced this issue Sep 27, 2023
vuongxuongminh added a commit that referenced this issue Oct 2, 2023
fix: declaration compatibility of ParentRuntime::createProcess #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant