Hi All i am having trouble on my pheanstalk sorry this is my first time of using this. My project involves a one save of 5000 entries the php when i work on gets 502 because of the traffic request.So my solution to these is to use a pheanstalk on the process here is my code below which is okay. I have installed the beanstalk on the server.
require("vendor/autoload.php");
use Pheanstalk\Pheanstalk;
$pheanstalk = new Pheanstalk('127.0.0.1');
#producer
$put = $pheanstalk->useTube("ashimatube".date("His"))
->put(json_encode(array("test"=>date("Yhs"))));
#worker
$job = $pheanstalk->watch("ashimatube".date("His"))
->ignore("default")->reserve();
Beanstalk
Beanstalk used in Facebook developed by Philotic, Inc to improves the response time for the Causes on the Facebook application (with over 10 million users). Beanstalk decreased the average response time for the most common pages to a tiny fraction of the original, significantly improving the user experience.
Here is the sample for Codeigniter
Pheastalk is a PHP client for beanstalkd queue.
Add Pheanstalk folder inside
application/libraries
.Create
pheanstalk.php
underapplication/config
.Add the following code.
Create Pheanstalk.php (P is in caps) under
application/libraries
.Add the following code.
Create a controller like this.
Just Try this way.