Example #1
0
 private void InitSerializer()
 {
     string type = ConfigManager.Configger.GetFirstOrAddConfig<CacheSection>().SerializerType;
     if (string.Equals(type, "json", StringComparison.OrdinalIgnoreCase))
     {
         Serializer = new JsonCacheSerializer(Encoding.UTF8);
     }
     else
     {
         Serializer = new ProtobufCacheSerializer();
     }
 }
Example #2
0
        static DataSyncQueueManager()
        {
            _asyncSendHandle += OnAsyncSend;
            _serializer = new ProtobufCacheSerializer();
            DataSyncQueueNum = ConfigUtils.GetSetting("DataSyncQueueNum", DefDataSyncQueueNum);
            if (DataSyncQueueNum < 1) DataSyncQueueNum = DefDataSyncQueueNum;
            SqlWaitSyncQueueNum = ConfigUtils.GetSetting("SqlWaitSyncQueueNum", DefSqlSyncWaitQueueNum);
            if (SqlWaitSyncQueueNum < 1) SqlWaitSyncQueueNum = DefSqlSyncWaitQueueNum;

            _isRedisSyncWorking = new int[DataSyncQueueNum];
            _isSqlWaitSyncWorking = new int[SqlWaitSyncQueueNum];
        }