Welcome Guest, Not a member yet? Register   Sign In
Integrating pheanstalk with CI
#1

[eluser]msgmash[/eluser]
Hi,

I want to use Pheanstalk with CI but, being a CI newcomer, I'm a little unsure about how to do this. What I have so far is pheanstalk in a directory under /var and a library class coded as follows:

Code:
<?php

require_once('pheanstalk_init.php');

// we're only going to write jobs to the beanstalk server
class MessageQueue {
    private $beanstalk;
    function __construct() {
        $this->beanstalk = new Pheanstalk(); // use default address and port
    }

    function put($body)
    {
        $this->beanstalk->put($body);
    }
}
?>

This then gets called every time a particular controller is requested.

I'm sure there must be a better way to do this, so am seeking advice!

Thanks

Simon


Messages In This Thread
Integrating pheanstalk with CI - by El Forum - 02-04-2012, 12:59 PM
Integrating pheanstalk with CI - by El Forum - 02-04-2012, 05:01 PM
Integrating pheanstalk with CI - by El Forum - 03-22-2013, 10:45 PM
Integrating pheanstalk with CI - by El Forum - 03-31-2014, 10:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB