在示例项目中没有这样的“未实现错误”。但是,类似的实现将这个“[AsyncStateMachine(typeof(SmartRetryExecutionPolicy.d__5<>))]”放在方法之前。
据我所知,使方法异步更改了签名,因此没有实现 Run 方法。我在这方面不是很有经验,所以任何帮助表示赞赏。
public delegate Task<RequestResult<T>> ExecuteRequestAsync<T>(CloneableRequestMessage request);
public interface IRequestExecutionPolicy
{
Task<RequestResult<T>> Run<T>(CloneableRequestMessage requestMessage, ExecuteRequestAsync<T> executeRequestAsync, CancellationToken cancellationToken, int? graphqlQueryCost = null);
}
public class LeakyBucketExecutionPolicy : IRequestExecutionPolicy{
public LeakyBucketExecutionPolicy(){}
public async Task<RequestResult<T>> Run<T>(CloneableRequestMessage baseRequest, ExecuteRequestAsync<T> executeRequestAsync, CancellationToken cancellationToken, int? graphqlQueryCost = null)
{
//retry code
}