Пример #1
0
 public BuildMessageBusiness()
 {
     _notifyMessageBus = new NotifyMessageBusiness();
     _pushMessageBus   = new PushMessageBusiness(BuilderServiceSetting.AutoFlushSendMessage);
     _notifySettingBus = new NotifyInterfaceSettingBusiness();
     if (BuilderServiceSetting.IsOpenBatchSaveNotifyMessage)
     {
         _saveNotifyPool = new DataBufferPool(new WaitCallback(BatchSaveNotifyMessage), BuilderServiceSetting.AutoFlushNotifyMessage, false);
     }
     if (BuilderServiceSetting.IsOpenBatchSavePushMessage)
     {
         _savePushPool = new DataBufferPool(new WaitCallback(BatchSavePushMessage), BuilderServiceSetting.AutoFlushPushMessage, false);
     }
     if (BuilderServiceSetting.IsOpenBatchReceiveHighMessage)
     {
         _highPool = new DataBufferPool(new WaitCallback(BuildBufferMessage), BuilderServiceSetting.AutoFlushReceiveHighMessage, false);
     }
     if (BuilderServiceSetting.IsOpenBatchReceiveMiddleMessage)
     {
         _middlePool = new DataBufferPool(new WaitCallback(BuildBufferMessage), BuilderServiceSetting.AutoFlushReceiveMiddleMessage, false);
     }
     if (BuilderServiceSetting.IsOpenBatchReceiveNormalMessage)
     {
         _normalPool = new DataBufferPool(new WaitCallback(BuildBufferMessage), BuilderServiceSetting.AutoFlushReceiveNormalMessage, false);
     }
     if (BuilderServiceSetting.IsOpenBatchReceiveLowMessage)
     {
         _lowPool = new DataBufferPool(new WaitCallback(BuildBufferMessage), BuilderServiceSetting.AutoFlushReceiveLowMessage, false);
     }
     _repeatSavePool = new DataBufferPool(new WaitCallback(RepeatSaveMessage), 5, false);
 }
Пример #2
0
 public SendMessageBusiness()
 {
     _pushMessageBus = new PushMessageBusiness();
     _pushSettingBus = new NotifyInterfaceSettingBusiness();
     if (SendServiceSetting.IsOpenBatchSendHighMessage)
     {
         _highPool = new DataBufferPool(new WaitCallback(SendBatch), SendServiceSetting.AutoFlushSendHighMessage, false);
     }
     if (SendServiceSetting.IsOpenBatchSendMiddleMessage)
     {
         _middlePool = new DataBufferPool(new WaitCallback(SendBatch), SendServiceSetting.AutoFlushSendMiddleMessage, false);
     }
     if (SendServiceSetting.IsOpenBatchSendNormalMessage)
     {
         _normalPool = new DataBufferPool(new WaitCallback(SendBatch), SendServiceSetting.AutoFlushSendNormalMessage, false);
     }
     if (SendServiceSetting.IsOpenBatchSendLowMessage)
     {
         _lowPool = new DataBufferPool(new WaitCallback(SendBatch), SendServiceSetting.AutoFlushSendLowMessage, false);
     }
     _repeatUpdatePool = new DataBufferPool(new WaitCallback(RepeatUpdatePushMessage), 10, false);
 }