IAsyncResultable.cs 590 B

123456789101112131415161718192021
  1. namespace XGame.Framework.Asyncs
  2. {
  3. /// <summary>
  4. /// 带有返回结束的异步,可通过GetResult获取结果
  5. /// 实现此接口的Awaiter 可通过await 获取值
  6. /// </summary>
  7. /// <typeparam name="TResult"></typeparam>
  8. public interface IAsyncResultable<TResult>
  9. {
  10. TResult GetResult();
  11. }
  12. /// <summary>
  13. /// 带有返回结束的异步,可通过GetResult获取结果
  14. /// 实现此接口的Awaiter 可通过await 获取值
  15. /// </summary>
  16. public interface IAsyncResultable
  17. {
  18. TResult GetResult<TResult>();
  19. }
  20. }