public void Awake()
        {
            //DBConfig config = StartConfigComponent.Instance.StartConfig.GetComponent<DBConfig>();
            //string connectionString = config.ConnectionString;
            StartConfig dbStartConfig = StartConfigComponent.Instance.DBConfig;
            CacheConfig cacheConfig   = dbStartConfig.GetComponent <CacheConfig>();

            if (cacheConfig == null)
            {
                redisClient = ConnectionMultiplexer.Connect(connectionString);
            }
            else
            {
                redisClient = ConnectionMultiplexer.Connect(cacheConfig.ConnectionString);
            }
            database = redisClient.GetDatabase();

            CollectCacheAttribute();

            ClearAllKey();

            for (int i = 0; i < taskCount; ++i)
            {
                DBTaskQueue taskQueue = ComponentFactory.Create <DBTaskQueue>();
                this.tasks.Add(taskQueue);
            }
        }
Esempio n. 2
0
 public void Awake()
 {
     for (int i = 0; i < taskCount; ++i)
     {
         DBTaskQueue taskQueue = ComponentFactory.Create <DBTaskQueue>();
         this.tasks.Add(taskQueue);
     }
 }
Esempio n. 3
0
        public void Awake()
        {
            BuildConnection();
            BuildDBSchema();

            for (int i = 0; i < taskCount; ++i)
            {
                DBTaskQueue taskQueue = ComponentFactory.Create <DBTaskQueue>();
                this.tasks.Add(taskQueue);
            }
        }
Esempio n. 4
0
        public void Awake()
        {
            DBConfig config           = StartConfigComponent.Instance.StartConfig.GetComponent <DBConfig>();
            string   connectionString = config.ConnectionString;

            mongoClient   = new MongoClient(connectionString);
            this.database = this.mongoClient.GetDatabase(config.DBName);
            for (int i = 0; i < taskCount; ++i)
            {
                DBTaskQueue taskQueue = ComponentFactory.Create <DBTaskQueue>();
                this.tasks.Add(taskQueue);
            }
        }