using System; using System.Collections.Concurrent; namespace IStation { /// /// 内存通道辅助类 /// public class MemoryQueueHelper { private static readonly BlockingCollection _queue = new BlockingCollection(new ConcurrentQueue()); /// /// 推送 /// public static bool Push(T model) { _queue.Add(model); return true; } /// /// 获取 /// public static T Take() { return _queue.Take(); } } }