Example #1
0
        private ObjectPool <BaseData> createRequestPool(int type)
        {
            ObjectPool <BaseData> pool = new ObjectPool <BaseData>(() => BytesControl.getRequestByID(type));

            pool.setNeedClear(false);
            return(pool);
        }
Example #2
0
        public BaseData createRequest(int type)
        {
            ObjectPool <BaseData> pool = _requestDic.get(type);

            if (pool == null)
            {
                return(BytesControl.getRequestByID(type));
            }

            return(pool.getOne());
        }