示例#1
0
        public ExpirationManager(MySqlStorage storage, MySqlStorageOptions storageOptions)
        {
            _storage        = storage ?? throw new ArgumentNullException("storage");
            _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions));

            _processedTables = new[]
            {
                $"{storageOptions.TablesPrefix}AggregatedCounter",
                $"{storageOptions.TablesPrefix}Job",
                $"{storageOptions.TablesPrefix}List",
                $"{storageOptions.TablesPrefix}Set",
                $"{storageOptions.TablesPrefix}Hash",
            };
        }
示例#2
0
        public static IGlobalConfiguration <MySqlStorage> UseMySqlStorage(
            [NotNull] this IGlobalConfiguration configuration,
            [NotNull] string nameOrConnectionString)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            if (nameOrConnectionString == null)
            {
                throw new ArgumentNullException("nameOrConnectionString");
            }

            var storage = new MySqlStorage(nameOrConnectionString);

            return(configuration.UseStorage(storage));
        }
示例#3
0
 public ExpirationManager(MySqlStorage storage)
     : this(storage, TimeSpan.FromHours(1))
 {
 }
 public MySqlDistributedLock(MySqlStorage storage, string resource, TimeSpan timeout, CancellationToken cancellationToken)
     : this(resource, timeout, cancellationToken)
 {
     _storage = storage;
 }
 public MySqlDistributedLock(MySqlStorage storage, string resource, TimeSpan timeout)
     : this(storage.CreateAndOpenConnection(), resource, timeout)
 {
     _storage = storage;
 }