コード例 #1
0
ファイル: Program.cs プロジェクト: yovannyr/CircuitBreaker
        static void Main(string[] args)
        {
            var testData = new List<Test>();
            testData.Add(new Test { Id = 1, Desc = "Fu" });
            testData.Add(new Test { Id = 2, Desc = "bar" });

            var breaker = new Breaker(typeof(StringBuilder));

            Action someAction;
            someAction = someMethod;

            breaker.ExecuteAction(someAction);
        }
コード例 #2
0
 private void DoThreadWork()
 {
     var randoBreaker = new Breaker(typeof(SomeRandomClass)); // setup a new breaker
     Assert.IsTrue(randoBreaker.IsClosed, "This random breaker is open and should be closed!");
     try
     {
         randoBreaker.ExecuteAction(this.DoException);
     }
     catch (CircuitBreakerOpenException)
     {
         // nom;
     }
 }