public static IDurableOperation New(DurableOperationArgs args) { throw Helpers.NewNotImplementedException(); }
public static IDurableOperation NewDoOnce(int retryTimeout, int timeToLive, string cancelationTag, Action action, string commentsFmt, params object[] commentsArgs) { var args = new DurableOperationArgs { RequiredRepeats = 1, RetryTimeout = retryTimeout, TimeToLive = timeToLive, CancelationTag = cancelationTag, Action = action, Comments = Helpers.SafeFormat(commentsFmt, commentsArgs) }; return new DurableOperation(args, DateTime.Now); }
private DurableOperation(DurableOperationArgs args, DateTime now) { _args = new CompiledArgs { RequiredRepeats = args.RequiredRepeats ?? 1, RepeatTimeout = TimeSpan.FromMilliseconds(args.RepeatTimeout ?? 0), RetryTimeout = TimeSpan.FromMilliseconds(args.RetryTimeout ?? 0), RetriresToLive = args.RetriesToLive ?? 0, TimeToLive = TimeSpan.FromMilliseconds(args.TimeToLive ?? 0), StartedAt = now, CancelationTag = args.CancelationTag, Action = args.Action, Comments = args.Comments, }; initialize_state(); }