Наследование: TaskQueue.Providers.QueueSpecificParameters
Пример #1
0
 private void CheckConnection()
 {
     if (!Connected)
     {
         MongoQueueParams mongoparams = this.connection.specParams as MongoQueueParams;
         OpenConnection(mongoparams);
     }
 }
Пример #2
0
        private void OpenConnection(MongoQueueParams mongoparams)
        {
            MongoClient cli    = new MongoClient(mongoparams.ConnectionString);
            var         server = cli.GetServer();
            var         db     = server.GetDatabase(mongoparams.Database);

            Collection = db.GetCollection <MongoQueue.MongoMessage>(mongoparams.Collection);
            Connected  = true;
        }
Пример #3
0
        public void InitialiseFromModel(RepresentedModel model, QueueConnectionParameters connection)
        {
            this.model      = model;
            this.connection = connection;

            SetSelector(TQItemSelector.DefaultFifoSelector);
            MongoQueueParams mongoparams = connection.specParams as MongoQueueParams;

            try
            {
                OpenConnection(mongoparams);
            }
            catch (Exception e)
            {
                throw new QueueConnectionException("can't open connection to: " + mongoparams.ConnectionString, e);
            }
        }
Пример #4
0
 private void OpenConnection(MongoQueueParams mongoparams)
 {
     MongoClient cli = new MongoClient(mongoparams.ConnectionString);
     var server = cli.GetServer();
     var db = server.GetDatabase(mongoparams.Database);
     Collection = db.GetCollection<MongoQueue.MongoMessage>(mongoparams.Collection);
     Connected = true;
 }