/// <summary> /// 获取一个 /// </summary> /// <param name="item"></param> public static DANMessage <T> TryTake() { var msg = new DANMessage <T>(); if (GlobalCollection.TryTake(out msg)) { return(msg); } return(null); }
/// <summary> /// 添加 /// </summary> /// <param name="item"></param> /// <returns></returns> public static bool TryAdd(DANMessage <T> item) { return(GlobalCollection.TryAdd(item)); }