zoukankan      html  css  js  c++  java
  • 队列

    <?php
    /**
     * php利用redis做队列
     * @author liuxin
     *
     */
    class phpRedisQueue{
        ##redis公共类
        static $phpRedis;
        /**
         * 引用redis类
         */
        function __construct(){
            if(is_null(self::$phpRedis)){
                include_once (WWW_PATH."/lib/phpRedis.class.php");
                self::$phpRedis = new phpRedis ();
            }
        }
        /**
         * L_C_48队列
         * @param unknown_type $key
         * @param unknown_type $value
         */
        public function set($key,$value){
            return self::$phpRedis->lpush($key, $value);
        }
        /**
         * 读取队列
         */
        public function get($key){
            return self::$phpRedis->lpop($key);
        }
    }

    <?php
    /**
    * php利用redis做队列
    * @author liuxin
    *
    */
    class phpRedisQueue{
    ##redis公共类
    static $phpRedis;
    /**
    * 引用redis类
    */
    function __construct(){
    if(is_null(self::$phpRedis)){
    include_once (WWW_PATH."/lib/phpRedis.class.php");
    self::$phpRedis = new phpRedis ();
    }
    }
    /**
    * L_C_48队列
    * @param unknown_type $key
    * @param unknown_type $value
    */
    public function set($key,$value){
    return self::$phpRedis->lpush($key, $value);
    }
    /**
    * 读取队列
    */
    public function get($key){
    return self::$phpRedis->lpop($key);
    }
    }

     
  • 相关阅读:
    996工作制是奋斗还是剥削?
    动态链接的PLT与GOT
    The Product-Minded Software Engineer
    缓冲区溢出
    golang的加法比C快?
    C errno是否是线程安全的
    golang 三个点的用法
    GDB 单步调试汇编
    为什么CPU需要时钟这种概念?
    fliebeat配置手册
  • 原文地址:https://www.cnblogs.com/hgj123/p/4390721.html
Copyright © 2011-2022 走看看