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

Manager->tick() always result false on multiple addTask.. #22

Open
royhg opened this issue Mar 25, 2018 · 1 comment
Open

Manager->tick() always result false on multiple addTask.. #22

royhg opened this issue Mar 25, 2018 · 1 comment

Comments

@royhg
Copy link

royhg commented Mar 25, 2018

Hi cgPitt,
I reproduced your code with a little modif in foreach loop..
But had that my $manager->tick() always result false without PHP error..
Result true on single addTask..
Did I had something wrong here? I used php70 version.

use AsyncPHP\Doorman\Manager\ProcessManager;
use AsyncPHP\Doorman\Task\ProcessCallbackTask;

$manager = new ProcessManager();
foreach($jobs as $job){
$manager->addTask(new ProcessCallbackTask(function()use($job){
doingJob($job);
}));
}
$manager>addRule($rule);
echo $manager->tick();

Regards,

@christopher-bonitz
Copy link

christopher-bonitz commented May 21, 2018

I have noticed the same behavior, I'm still investigating the root cause, so far I have noticed some strange behavior on the Serialize method.

Roughly around Line 484 in ProcessManager.php

It seems to at least compile when I change it to this. (base64 encode before serialize)

    private function getTaskString(Task $task)
    {
        $result = serialize(base64_encode($task));
        //echo($result);
        return $result;
    }

Although I'm now poking around in the code, I'm still not up and running yet.

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

2 participants