CodeIgniter Forums
Threading integration in codeigniter ver 3.1 and php ver >=5.6 not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Threading integration in codeigniter ver 3.1 and php ver >=5.6 not working (/showthread.php?tid=68830)



Threading integration in codeigniter ver 3.1 and php ver >=5.6 not working - damku999 - 09-01-2017

Hello Everyone could anyone help me for the below.

I am trying create on library class which has do some curl call using my model method.
see below code snippet-
PHP Code:
class CI_Multi_thread extends Thread {
   protected $CI;
   public function __construct($data=array()) {
       $this->CI =&get_instance();
   }
   public function run($data=array()) {
       $this->faux_apikey=$data['faux_apikey'];
       $this->faux_apisecret=$data['faux_apisecret'];
       $this->device_ip=$data['device_ip'];
       $this->device_id=$data['device_id'];
       $this->fk_group_id=$data['fk_group_id'];
       
       $this
->CI->load->model('Fauxapi_model','fm',TRUE);
       $this->CI->fm->processing_logs($this->device_id,$this->fk_group_id);
       $this->CI->fm->config_set($this->faux_apikey,$this->faux_apisecret,$this->device_ip,$this->device_id,$this->fk_group_id);
   }

but &get_instance(); is not working. show "Fatal error: Cannot assign by reference to overloaded object in C:\xampp\htdocs\darshan\system\libraries\Multi_thread.php on line 8
"
also my server is also close my current process when last running thread is stop.

after all it stop my complete server working for 5 second.

I am also attaching my libraries and model file here.