Example #1
0
        public BaseSqlJobQueuePurger(IJobQueueDataConnectionFactory jobQueueConnectionFactory,
                                     ISqlDbJobQueueTableConfiguration tableConfig)
        {
            _jobQueueConnectionFactory = jobQueueConnectionFactory;

            _mappingSchema = Mapping.BuildMappingSchema(tableConfig);
        }
 public QueueNameBasedJobAdderQueueTableResolver(
     Dictionary <string, ISqlDbJobQueueTableConfiguration> queueTableConfigurations,
     ISqlDbJobQueueTableConfiguration defaultTableConfiguration)
 {
     _queueTableMappings        = queueTableConfigurations;
     _defaultTableConfiguration = defaultTableConfiguration;
 }
Example #3
0
        public static string SuggestedIndexes(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create index {2}_jobguid_idx on {2}(JobGuid);
create index {1}_jobguid_idx on {1}(JobGuid);
create unique  index {0}_jobguid_idx on {0}(JobGuid);
", config.QueueTableName, config.ParamTableName, config.JobMethodGenericParamTableName));
        }
Example #4
0
        public BaseSqlJobQueueManager(IJobQueueDataConnectionFactory jobQueueConnectionFactory,
                                      ISqlDbJobQueueTableConfiguration jobQueueTableConfiguration, IJobTypeResolver typeResolver)
        {
            _jobQueueConnectionFactory = jobQueueConnectionFactory;

            _jobQueueTableConfiguration = jobQueueTableConfiguration;
            _typeResolver = typeResolver;

            _mappingSchema = MappingSchema.Default.GetFluentMappingBuilder();
        }
Example #5
0
        public static string JobQueueJobMethodGenericParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create table {0}
(
Id INTEGER primary key,
JobGuid UniqueIdentifier not null,
ParamOrder int not null,
ParamTypeName text not null
)", config.JobMethodGenericParamTableName));
        }
Example #6
0
        public static string JobQueueJobMethodGenericParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create table {0}
(
Id bigint not null identity(1,1) primary key,
JobGuid UniqueIdentifier not null,
ParamOrder int not null,
ParamTypeName nvarchar(255) not null,
)", config.JobMethodGenericParamTableName));
        }
Example #7
0
        public static string JobQueueParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
Create table {0}
(
Id INTEGER PRIMARY KEY,
JobGuid uniqueidentifier not null, 
ParamOrdinal int not null,
SerializedValue text null,
SerializedType nvarchar(255) null,
ParameterName nvarchar(255) null
)", config.ParamTableName));
        }
Example #8
0
        public static string JobQueueParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
Create table {0}
(
Id bigint not null identity(1,1) primary key,
JobGuid uniqueidentifier not null, 
ParamOrdinal int not null,
SerializedValue nvarchar(max) null,
SerializedType nvarchar(255) null,
ParameterName nvarchar(255) null
)", config.ParamTableName));
        }
Example #9
0
        public static string JobTableCreateScript(ISqlDbJobQueueTableConfiguration configuration)
        {
            return(string.Format(@"

create Table {0}
(
Id INTEGER PRIMARY KEY,
QueueName NVarchar(255) not null,
TypeExecutedOn NVarChar(255) not null,
MethodName NVarChar(255) not null,
DoNotExecuteBefore datetime null,
JobGuid uniqueidentifier not null,
Status NVarChar(32) not null,
MaxRetries int,
MinRetryWait int,
RetryCount int,
LockClaimTime datetime null,
LockGuid uniqueidentifier null,
LastAttempt datetime null,
CreatedDate datetime not null)
", configuration.QueueTableName));
        }
Example #10
0
        public static FluentMappingBuilder BuildMappingSchema(ISqlDbJobQueueTableConfiguration _jobQueueTableConfiguration)
        {
            var mapper = new LinqToDB.Mapping.FluentMappingBuilder(MappingSchema.Default);

            mapper.Entity <SqlCommonDbOddJobMetaData>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.QueueTableName)
            {
                IsColumnAttributeRequired = false, Name = _jobQueueTableConfiguration.QueueTableName
            });
            mapper.Entity <SqlCommonOddJobParamMetaData>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.ParamTableName)
            {
                IsColumnAttributeRequired = false, Name = _jobQueueTableConfiguration.ParamTableName
            });
            mapper.Entity <SqlDbOddJobMethodGenericInfo>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.JobMethodGenericParamTableName)
            {
                IsColumnAttributeRequired = false,
                Name = _jobQueueTableConfiguration.JobMethodGenericParamTableName
            });

            return(mapper);
        }
 public DefaultJobAdderQueueTableResolver(ISqlDbJobQueueTableConfiguration tableConfiguration) : base(
         new Dictionary <string, ISqlDbJobQueueTableConfiguration>(), tableConfiguration)
 {
 }
Example #12
0
 public SQLiteJobQueueManager(SQLiteJobQueueDataConnectionFactory jobQueueDataConnectionFactory,
                              ISqlDbJobQueueTableConfiguration tableConfiguration, IJobTypeResolver typeResolver) : base(
         jobQueueDataConnectionFactory, tableConfiguration, typeResolver)
 {
 }
Example #13
0
 public SqlServerJobQueueManager(SqlServerDataConnectionFactory jobQueueConnectionFactory,
                                 ISqlDbJobQueueTableConfiguration tableConfig, IJobTypeResolver typeResolver) : base(jobQueueConnectionFactory,
                                                                                                                     tableConfig, typeResolver)
 {
 }