本文整理汇总了C#中IWriteOnlyTransaction类的典型用法代码示例。如果您正苦于以下问题:C# IWriteOnlyTransaction类的具体用法?C# IWriteOnlyTransaction怎么用?C# IWriteOnlyTransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWriteOnlyTransaction类属于命名空间,在下文中一共展示了IWriteOnlyTransaction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.AddToSet(
"failed",
context.JobId,
JobHelper.ToTimestamp(DateTime.UtcNow));
}
开发者ID:atonse,项目名称:Hangfire,代码行数:7,代码来源:FailedStateHandler.cs
示例2: FailedStateHandlerFacts
public FailedStateHandlerFacts()
{
_context = new ApplyStateContextMock();
_context.StateContextValue.JobIdValue = JobId;
_context.NewStateValue = new FailedState(new InvalidOperationException());
_transaction = Substitute.For<IWriteOnlyTransaction>();
}
开发者ID:okusnadi,项目名称:Hangfire.Redis.StackExchange,代码行数:8,代码来源:FailedStateHandlerFacts.cs
示例3: Apply
public override void Apply(
ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.AddToSet(
"processing",
context.JobId,
JobHelper.ToTimestamp(DateTime.UtcNow));
}
开发者ID:hahmed,项目名称:HangFire,代码行数:8,代码来源:ProcessingStateHandler.cs
示例4: OnStateUnapplied
public void OnStateUnapplied(
ApplyStateContext context, IWriteOnlyTransaction transaction)
{
Assert.NotNull(context);
Assert.NotNull(transaction);
_results.Add(String.Format("{0}::{1}", _name, "OnStateUnapplied"));
}
开发者ID:hahmed,项目名称:HangFire,代码行数:8,代码来源:TestStateChangedFilter.cs
示例5: ProcessingStateHandlerFacts
public ProcessingStateHandlerFacts()
{
_context = new ApplyStateContextMock();
_context.StateContextValue.JobIdValue = JobId;
_context.NewStateValue = new ProcessingState("server", 1);
_transaction = Substitute.For<IWriteOnlyTransaction>();
}
开发者ID:okusnadi,项目名称:Hangfire.Redis.StackExchange,代码行数:8,代码来源:ProcessingStateHandlerFacts.cs
示例6: DeletedStateHandlerFacts
public DeletedStateHandlerFacts()
{
_context = new ApplyStateContextMock();
_context.StateContextValue.JobIdValue = JobId;
_context.NewStateValue = new DeletedState();
_transaction = Substitute.For<IWriteOnlyTransaction>();
}
开发者ID:okusnadi,项目名称:Hangfire.Redis.StackExchange,代码行数:8,代码来源:DeletedStateHandlerFacts.cs
示例7: SucceededStateHandlerFacts
public SucceededStateHandlerFacts()
{
_context = new ApplyStateContextMock();
_context.StateContextValue.JobIdValue = JobId;
_context.NewStateValue = new SucceededState(null, 11, 123);
_transaction = Substitute.For<IWriteOnlyTransaction>();
}
开发者ID:okusnadi,项目名称:Hangfire.Redis.StackExchange,代码行数:8,代码来源:SucceededStateHandlerFacts.cs
示例8: OnStateApplied
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
var awaitingState = context.NewState as AwaitingState;
if (awaitingState != null)
{
context.JobExpirationTimeout = awaitingState.Expiration;
}
}
开发者ID:djrineh,项目名称:Hangfire,代码行数:8,代码来源:ContinuationsSupportAttribute.cs
示例9: OnStateApplied
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
var failedState = context.NewState as FailedState;
if (failedState != null)
{
Logger.ErrorException(
String.Format("Background job #{0} was failed with an exception.", context.JobId),
failedState.Exception);
}
}
开发者ID:TSalaam,项目名称:Hangfire.Mailer,代码行数:10,代码来源:LogFailureAttribute.cs
示例10: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
var enqueuedState = context.NewState as EnqueuedState;
if (enqueuedState == null)
{
throw new InvalidOperationException(String.Format(
"`{0}` state handler can be registered only for the Enqueued state.",
typeof(Handler).FullName));
}
transaction.AddToQueue(enqueuedState.Queue, context.JobId);
}
开发者ID:richardprice,项目名称:HangFire,代码行数:12,代码来源:EnqueuedState.cs
示例11: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
var scheduledState = context.NewState as ScheduledState;
if (scheduledState == null)
{
throw new InvalidOperationException(String.Format(
"`{0}` state handler can be registered only for the Scheduled state.",
typeof(Handler).FullName));
}
var timestamp = JobHelper.ToTimestamp(scheduledState.EnqueueAt);
transaction.AddToSet("schedule", context.JobId, timestamp);
}
开发者ID:henningst,项目名称:HangFire,代码行数:13,代码来源:ScheduledState.cs
示例12: ApplyState
public void ApplyState(IWriteOnlyTransaction transaction, ApplyStateContext context)
{
var filterInfo = GetFilters(context.Job);
var filters = filterInfo.ApplyStateFilters;
foreach (var state in context.TraversedStates)
{
transaction.AddJobState(context.JobId, state);
}
foreach (var handler in _handlers.GetHandlers(context.OldStateName))
{
handler.Unapply(context, transaction);
}
foreach (var filter in filters)
{
filter.OnStateUnapplied(context, transaction);
}
transaction.SetJobState(context.JobId, context.NewState);
foreach (var handler in _handlers.GetHandlers(context.NewState.Name))
{
handler.Apply(context, transaction);
}
foreach (var filter in filters)
{
filter.OnStateApplied(context, transaction);
}
if (context.NewState.IsFinal)
{
transaction.ExpireJob(context.JobId, context.JobExpirationTimeout);
}
else
{
transaction.PersistJob(context.JobId);
}
}
开发者ID:djrineh,项目名称:Hangfire,代码行数:41,代码来源:DefaultStateChangeProcess.cs
示例13: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.InsertToList("deleted", context.BackgroundJob.Id);
transaction.TrimList("deleted", 0, 99);
}
开发者ID:Trov,项目名称:Hangfire.Mongo,代码行数:5,代码来源:DeletedStateHandler.cs
示例14: Unapply
public void Unapply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.RemoveFromList("deleted", context.BackgroundJob.Id);
}
开发者ID:Trov,项目名称:Hangfire.Mongo,代码行数:4,代码来源:DeletedStateHandler.cs
示例15: Unapply
public void Unapply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.DecrementCounter("stats:deleted");
}
开发者ID:henningst,项目名称:HangFire,代码行数:4,代码来源:DeletedState.cs
示例16: Unapply
public void Unapply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.RemoveFromList("succeeded", context.JobId);
}
开发者ID:atonse,项目名称:Hangfire,代码行数:4,代码来源:SucceededStateHandler.cs
示例17: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.InsertToList("succeeded", context.JobId);
transaction.TrimList("succeeded", 0, 99);
}
开发者ID:atonse,项目名称:Hangfire,代码行数:5,代码来源:SucceededStateHandler.cs
示例18: Unapply
public void Unapply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.RemoveFromSet("failed", context.JobId);
}
开发者ID:sirchas,项目名称:Hangfire.Mongo,代码行数:4,代码来源:FailedStateHandler.cs
示例19: OnStateApplied
/// <inheritdoc />
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
if (context.NewState is ScheduledState &&
context.NewState.Reason != null &&
context.NewState.Reason.StartsWith("Retry attempt"))
{
transaction.AddToSet("retries", context.BackgroundJob.Id);
}
}
开发者ID:harriyott,项目名称:Hangfire,代码行数:10,代码来源:AutomaticRetryAttribute.cs
示例20: Apply
public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
transaction.IncrementCounter("stats:succeeded");
}
开发者ID:richardprice,项目名称:HangFire,代码行数:4,代码来源:SucceededState.cs
注:本文中的IWriteOnlyTransaction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论