Пример #1
0
        /// <summary>
        /// 从缓冲池里获得一个对象
        /// </summary>
        /// <returns></returns>
        public static ParamActionTask <T> AcquireContent(string actionName)
        {
            var ret = TaskPool.AcquireContent();

            ret.isRelease   = false;
            ret.TaskProfile = ActionTaskProfile.GetNetTaskProfile(actionName);
            ret.CreateTime  = OneServer.NowTime;
            return(ret);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="actionName"></param>
        /// <returns></returns>
        public static ActionTaskProfile GetNetTaskProfile(string actionName)
        {
            ActionTaskProfile ret;

            if (Map.TryGetValue(actionName, out ret))
            {
                return(ret);
            }

            //  新建一个包处理,然后
            ret = new ActionTaskProfile(actionName);
            Map.TryAdd(actionName, ret);

            return(ret);
        }