开发者

Automatic bookkeeping for exception retries [closed]

开发者 https://www.devze.com 2023-01-04 11:55 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_StackOverflow
Closed. This question needs to be more focused. It is not currently accepting answers.
开发者_StackOverflow

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 8 years ago.

Improve this question

Do any languages that support retry constructs in exception handling track and expose the number of times their catch/rescue (and/or try/begin) blocks have been executed in a particular run?

I find myself counting (and limiting) the number of times a code block is re-executed after an exception often enough that this would be a handy language built-in.


This is a really interesting question. I did a little research and apparently there is a design pattern called the circuit breaker pattern which was developed to handle such things. I have never heard of the pattern before and can't find much information about it.

There is a library which handles retrying an event for .NET available, might be worth a look. Heres a link to an article about it:

http://www.tobinharris.com/past/2009/1/26/net-circuit-breakers/

0

精彩评论

暂无评论...
验证码 换一张
取 消