@@ -16,25 +16,29 @@ public abstract partial class ResilienceStrategy
1616 internal ResilienceStrategyOptions ? Options { get ; set ; }
1717
1818 /// <summary>
19- /// Executes the specified callback.
19+ /// An implementation of resilience strategy that executes the specified <paramref name=" callback"/> .
2020 /// </summary>
2121 /// <typeparam name="TResult">The type of result returned by the callback.</typeparam>
2222 /// <typeparam name="TState">The type of state associated with the callback.</typeparam>
2323 /// <param name="callback">The user-provided callback.</param>
2424 /// <param name="context">The context associated with the callback.</param>
2525 /// <param name="state">The state associated with the callback.</param>
26- /// <returns>An instance of <see cref="ValueTask"/> that represents an asynchronous callback.</returns>
26+ /// <returns>
27+ /// An instance of pending <see cref="ValueTask"/> for asynchronous executions or completed <see cref="ValueTask"/> task for synchronous exexutions.
28+ /// </returns>
2729 /// <remarks>
28- /// This method is called by various methods exposed on <see cref="ResilienceStrategy"/>. These methods make sure that
29- /// <paramref name="context"/> is properly initialized with details about the execution mode.
30+ /// <strong>This method is called for both synchronous and asynchronous execution flows.</strong>
3031 /// <para>
31- /// The provided callback never throws an exception. Instead, the exception is captured and converted to an <see cref="Outcome{TResult}"/>.
32+ /// You can use <see cref="ResilienceContext.IsSynchronous"/> to dermine wheether the <paramref name="callback"/> is synchronous or asynchronous one.
33+ /// This is useful when the custom strategy behaves differently in each execution flow. In general, for most strategies, the implementation
34+ /// is the same for both execution flows.
3235 /// </para>
3336 /// <para>
34- /// Do not throw exceptions from your strategy implementation. Instead, return an exception instance as <see cref="Outcome{TResult}"/>.
37+ /// The provided callback never throws an exception. Instead, the exception is captured and converted to an <see cref="Outcome{TResult}"/>.
38+ /// Similarly, do not throw exceptions from your strategy implementation. Instead, return an exception instance as <see cref="Outcome{TResult}"/>.
3539 /// </para>
3640 /// </remarks>
37- protected internal abstract ValueTask < Outcome < TResult > > ExecuteCoreAsync < TResult , TState > (
41+ protected internal abstract ValueTask < Outcome < TResult > > ExecuteCore < TResult , TState > (
3842 Func < ResilienceContext , TState , ValueTask < Outcome < TResult > > > callback ,
3943 ResilienceContext context ,
4044 TState state ) ;
@@ -44,7 +48,7 @@ private Outcome<TResult> ExecuteCoreSync<TResult, TState>(
4448 ResilienceContext context ,
4549 TState state )
4650 {
47- return ExecuteCoreAsync (
51+ return ExecuteCore (
4852 static ( context , state ) =>
4953 {
5054 var result = state . callback ( context , state . state ) ;
0 commit comments