MethodBoundaryAspect.Fody icon indicating copy to clipboard operation
MethodBoundaryAspect.Fody copied to clipboard

It is possilbe to make a Retry attribute?

Open shuizhugeju opened this issue 3 years ago • 2 comments

It is possilbe to make a Retry attribute

shuizhugeju avatar Nov 15 '21 02:11 shuizhugeju

Unfortunately with our aspect it is only possible to execute code before and after the method call but it is not possible to reexecute the weaved method.

In PostSharp this is possible via the MethodInterceptionAspect

Alternative to AOP you can use the Polly library to create error handling and mitigating policies in code: https://github.com/App-vNext/Polly

Ralf1108 avatar Nov 15 '21 09:11 Ralf1108

example retry Polly policy: https://github.com/App-vNext/Polly#retry

Ralf1108 avatar Nov 15 '21 09:11 Ralf1108