-
Notifications
You must be signed in to change notification settings - Fork 7
php queue with memcache or redis etc.
rainkid/queue
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
########################################## 基于第三方KV存储的消息队列 ######################################### example for memacache: ```php <?php echo "Memcache队列测试:<br />"; //实例化Memcache $mc = new Memcache; $mc->connect('127.0.0.1', 11211); //实例化消息队列 $queue = new Queue($mc); $name = "Memcache"; //写入消息队列 $queue->put($name, "Memcache消息队列测试--".rand(0,100)); //出消息队列 $temp = $queue->get($name); var_dump($temp); $temp = $queue->status($name); var_dump($temp); ?> ``` ######################################### example for Tokyotrant: ```php <?php $tt = new Memcache; $tt->connect('127.0.0.1', 1978); //实例化消息队列 $queue = new Queue($tt); $name = "Tokyotrant"; //写入消息队列 $queue->put($name, "Tokyotrant消息队列测试--".rand(0,100)); //出消息队列 $temp = $queue->get($name); var_dump($temp); $temp = $queue->status($name); var_dump($temp); ?> ``` ######################################### example for Redis: ```php <?php $redis = new Redis; $redis->connect('127.0.0.1', 1978); //实例化消息队列 $queue = new Queue($tt); $name = "Redis"; //写入消息队列 $queue->put($name, "Redis消息队列测试--".rand(0,100)); //出消息队列 $temp = $queue->get($name); var_dump($temp); $temp = $queue->status($name); var_dump($temp); ?> ```
About
php queue with memcache or redis etc.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published