IRpcInvoker.cs 1.3 KB

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