simple-fork-php icon indicating copy to clipboard operation
simple-fork-php copied to clipboard

you should extend the `\Jenner\SimpleFork\Process` and overwrite the run method

Open Jim-Raynor opened this issue 7 years ago • 2 comments

https://github.com/huyanping/simple-fork-php/blob/4af8f61b283a612492ca9ab790472309ce681156/src/FixedPool.php#L34

Attempt to run process, constructed with Runnable, cause exeception "you should extend the \Jenner\SimpleFork\Process and overwrite the run method" from FixedPool::execute()

Jim-Raynor avatar Feb 15 '18 15:02 Jim-Raynor

Had the same problem. I did what I was told and created an extension like this: class JobRunner extends \Jenner\SimpleFork\Process { function __construct($job) { parent::__construct($job); } } Then use this class instead: $pool->execute(new JobRunner(new OneJob()) Don't know what this is good for but it works....

HorstBrack avatar Apr 08 '18 16:04 HorstBrack

Thanks. I have been too busy. If possible can you create a pull request?

white-poto avatar May 04 '18 17:05 white-poto