Ejemplo n.º 1
0
        public IMergeableOperationBuilder MakeThrottle <T>(Action <T> execute, T newValue, T oldValue, object key, TimeSpan convergeTimeSpan)
        {
            var judge = new ThrottleMergeJudge <int>(key.GetHashCode(), convergeTimeSpan);

            return(new MergeableBuilder <T>(new MergeableOperation <T>(execute, newValue, oldValue, judge)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 値が頻繁に変わるときに
        /// </summary>
        /// <param name="execute"></param>
        /// <param name="rollback"></param>
        /// <param name="key"></param>
        /// <param name="convergeTimeSpan"></param>
        /// <returns></returns>
        public IMergeableOperationBuilder MakeThrottle(Action execute, Action rollback, object key, TimeSpan convergeTimeSpan)
        {
            var judge = new ThrottleMergeJudge <int>(key.GetHashCode(), convergeTimeSpan);

            return(new MergeableBuilder(new MergeableOperation(execute, rollback, judge)));
        }