Closed aabhishek04 closed 1 year ago
I'am not getting response from user define methods . is there any way to get response to hit user method and get response...
<?php
use Amp\Parallel\Worker; use Amp\Promise;
class TestController {
public function getSum($a,$b){ return $a+$b; } public function getDivsion($a,$b){ return $a/$b; } public function getMultipel($a,$b){ return $a*$b; } public function algoExecution() { $funs = [ $this->getSum(2,2), $this->getDivsion(2,2), $this->getMultipel(2,2) ]; $promises = []; foreach ($funs as $fun) { $promises[] = Worker\enqueueCallable('call_user_func',$fun); } $responses = Promise\wait(Promise\all($promises)); foreach ($responses as $key => $response) { \printf($response, $key); } }
}
I'am not getting response from user define methods . is there any way to get response to hit user method and get response...
<?php
use Amp\Parallel\Worker; use Amp\Promise;
class TestController {
}