Esempio n. 1
0
        /// <summary>
        /// 异步发送Cache通知
        /// </summary>
        /// <param name="notifyDataArray">Cache通知数据</param>
        public void SendNotifyAsync(params CacheNotifyData[] notifyDataArray)
        {
            SendDataWrapper sdWrapper = new SendDataWrapper(
                notifyDataArray,
                GetSerializedCacheData(notifyDataArray),
                UdpCacheNotifierSettings.GetConfig().EndPoints);

            ThreadPool.QueueUserWorkItem(new WaitCallback(SendNotifyThreadCallBack), sdWrapper);
        }
        /// <summary>
        /// 异步发送Cache通知
        /// </summary>
        /// <param name="notifyDataArray">Cache通知数据</param>
        public void SendNotifyAsync(params CacheNotifyData[] notifyDataArray)
        {
            SendDataWrapper sdWrapper = new SendDataWrapper(
                notifyDataArray,
                GetSerializedCacheData(notifyDataArray),
                UdpCacheNotifierSettings.GetConfig().EndPoints);

            ThreadPool.QueueUserWorkItem(new WaitCallback(SendNotifyThreadCallBack), sdWrapper);
        }
Esempio n. 3
0
        private static void SendNotifyThreadCallBack(object context)
        {
            SendDataWrapper sdWrapper = (SendDataWrapper)context;

            SendSerializedData(sdWrapper.OriginalNotifyData, sdWrapper.DataList, sdWrapper.Targets);
        }