Closed brmcghee closed 2 years ago
I also want to note,
with "entrypoint" we have also done it this way:
$taskManager->add(new CreateTask)->run();
This works on windows 10 with php 8.0.17
But on Debian Php 8.0.17 it returns an error on the code:
TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given
0 {main} in /vendor/spatie/async/src/Output/SerializableException.php:29
Stack trace:
0 /vendor/spatie/async/src/Process/ParallelProcess.php(121): Spatie\Async\Output\SerializableException->asThrowable()
1 /vendor/spatie/async/src/Process/ProcessCallbacks.php(54): Spatie\Async\Process\ParallelProcess->resolveErrorOutput()
2 /vendor/spatie/async/src/Pool.php(232): Spatie\Async\Process\ParallelProcess->triggerError()
3 /vendor/spatie/async/src/Pool.php(328): Spatie\Async\Pool->markAsFailed()
4 /vendor/spatie/async/src/Pool.php(154): Spatie\Async\Pool->Spatie\Async\{closure}()
5 /class/scheduler.class.php(53): Spatie\Async\Pool->wait()
6 entrypoint.php(15): TaskScheduler->run()
7 {main}
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
For me it was running without specifying the binary (am running in a docker container). By default, it was using the php-fpm as the binary, which seems not to exists / work. So when creating the pull, specify the PATH of php which you can get by running whereis php
form within the docker container:
$pool = Pool::create()->withBinary('/usr/local/bin/php');
Hello,
we have been trying to test this and it works on windows but when we use debian we get this error:
[POOL:SUPPORTED]1[/POOL:SUPPORTED]
[ERROR] Spatie\Async\Output\ParallelError in /src/vendor/spatie/async/src/Output/ParallelError.php:11
Stack trace: 0 /src/vendor/spatie/async/src/Process/ParallelProcess.php(125): Spatie\Async\Output\ParallelError::fromException() 1 /src/vendor/spatie/async/src/Process/ProcessCallbacks.php(54): Spatie\Async\Process\ParallelProcess->resolveErrorOutput() 2 /src/vendor/spatie/async/src/Pool.php(232): Spatie\Async\Process\ParallelProcess->triggerError() 3 /src/vendor/spatie/async/src/Pool.php(328): Spatie\Async\Pool->markAsFailed() 4 /src/vendor/symfony/process/Process.php(887): Spatie\Async\Pool->Spatie\Async{closure}() 5 /src/vendor/symfony/process/Process.php(213): Symfony\Component\Process\Process->stop() 6 [internal function]: Symfony\Component\Process\Process->__destruct() 7 {main} [/ERROR]
class TaskScheduler:
class CreateTask extended Task
When our script starts it calls the following:
entryfile:
So i have run the composer tests and all passed. I have verified pcntl and posix are enabled.
above Script works on a Windows 11 Environment with PHP v 8.0.8. Throws above noted error with PHP 7.4 or 8.0 on Debian 10.
command running:
php -f entryfile.php
The Goal is that the entry point will create individual pools for each group of tasks that we add to it. Each Pool will then process everything it needs to based on the tasks added to it.
php -v
thanks in advance.