IRpcInvoker.cs 1.2 KB

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using EdjCase.JsonRpc.Core;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Http;
  6. namespace EdjCase.JsonRpc.Router.Abstractions
  7. {
  8. public interface IRpcInvoker
  9. {
  10. /// <summary>
  11. /// Call the incoming Rpc request method and gives the appropriate response
  12. /// </summary>
  13. /// <param name="request">Rpc request</param>
  14. /// <param name="path">Rpc path that applies to the current request</param>
  15. /// <param name="routeContext">The context of the current rpc request</param>
  16. /// <returns>An Rpc response for the request</returns>
  17. Task<RpcResponse> InvokeRequestAsync(RpcRequest request, RpcPath path, IRouteContext routeContext);
  18. /// <summary>
  19. /// Call the incoming Rpc requests methods and gives the appropriate respones
  20. /// </summary>
  21. /// <param name="requests">List of Rpc requests to invoke</param>
  22. /// <param name="path">Rpc route that applies to the current request</param>
  23. /// <param name="routeContext">The context of the current rpc request</param>
  24. /// <returns>List of Rpc responses for the requests</returns>
  25. Task<List<RpcResponse>> InvokeBatchRequestAsync(IList<RpcRequest> requests, RpcPath path, IRouteContext routeContext);
  26. }
  27. }