php - Call python gearman worker using laravel 5 -


i using laravel 5. need call python gearman worker.

i have created gearman worker in python. , have created gearman client in laravel 5.

i have directly added gearman client code in controller like:

$client = new gearmanclient(); $client->addserver(); $job_data = array("func_name" => "searchtweets", "query" => "query_to_search"); $result = $client->donormal("php_twitter_worker", json_decode($job_data)); if ($result) {     print_r($result); } 

but throws error :

class 'app\http\controllers\gearmanclient' not found 

i know error because don't have gearmanclient class in controllers. don't know how use it.

after doing r&d , found package using gearman in laravel5 not getting how use gearman client , how make call python gearman worker.

any on ?

because class namespaced, controller there, php class inside of namespace.

therefore, use class root namespace, should either use use statement or prefix classname \, \ being root namespace.

use gearmanclient;  $client = new \gearmanclient(); 

use 1 or other, not both, code above quite confusing...


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -