Usrlocals php use beanstalkd process sharing
I. Installation
1. install libevent
Reference
Wget http://cloud.github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gz
Cp libevent-1.4.14b-stable.tar.gz/usr/local/src/
Tar zxvf libevent-1.4.14b-stable.tar.gz
Cd libevent-1.4.14b-stable
./Configure -- prefix =/usr/local/libevent
Make
Make install
2. install beanstalkd (this article provides an attachment)
Reference
Cp beanstalkd-1.4.6.tar.gz/usr/local/src/
Tar zxvf beanstalkd-1.4.6.tar.gz
Cd beanstalkd-1.4.6
./Configure -- prefix =/usr/local/beanstalkd
Make
Make install
./Beanstalkd-d-l 127.0.0.1-p 11300
3. for the use of the php client, we recommend that you use the source code instead of the extension method.
Http://sourceforge.net/projects/beanstalk/ Download php client code
Reference
Require ('./BeanStalk. class. php ');
$ Beanstalk = BeanStalk: open (array (
'Servers' => array ('2017. 0.0.1: 100 '),
'Select' => 'randpeek'
));
$ Beanstalk-> use_tube ('Foo ');
$ Beanstalk-& gt; put (0, 0,120, 'Say hello world ');
$ Beanstalk-> watch ('Foo ');
$ Job = $ beanstalk-> reserve_with_timeout ();
Echo $ job-> get (); // Output: 'Say hello world'
Beanstalk: delete ($ job); // Delete the job.
?>