C# Класс EdjCase.JsonRpc.Router.RpcRouter

Router for Asp.Net to direct Http Rpc requests to the correct method, invoke it and return the proper response
Наследование: IRouter
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
SetErrorResponse System.Threading.Tasks.Task
SetResponse System.Threading.Tasks.Task

Открытые методы

Метод Описание
GetVirtualPath ( VirtualPathContext context ) : VirtualPathData

Generates the virtual path data for the router

RouteAsync ( Microsoft.AspNetCore.Routing.RouteContext context ) : System.Threading.Tasks.Task

Takes a route/http contexts and attempts to parse, invoke, respond to an Rpc request

RpcRouter ( IOptions serverConfig, IRpcInvoker invoker, IRpcParser parser, IRpcCompressor compressor, ILogger logger, IRpcRouteProvider routeProvider ) : System

Приватные методы

Метод Описание
SetErrorResponse ( Microsoft.AspNetCore.Routing.RouteContext context, RpcException exception ) : System.Threading.Tasks.Task

Sets the http response to the corresponding Rpc exception

SetResponse ( Microsoft.AspNetCore.Routing.RouteContext context, List responses, bool isBulkRequest, JsonSerializerSettings jsonSerializerSettings = null ) : System.Threading.Tasks.Task

Sets the http response with the given Rpc responses

Описание методов

GetVirtualPath() публичный Метод

Generates the virtual path data for the router
public GetVirtualPath ( VirtualPathContext context ) : VirtualPathData
context VirtualPathContext Virtual path context
Результат VirtualPathData

RouteAsync() публичный Метод

Takes a route/http contexts and attempts to parse, invoke, respond to an Rpc request
public RouteAsync ( Microsoft.AspNetCore.Routing.RouteContext context ) : System.Threading.Tasks.Task
context Microsoft.AspNetCore.Routing.RouteContext Route context
Результат System.Threading.Tasks.Task

RpcRouter() публичный Метод

public RpcRouter ( IOptions serverConfig, IRpcInvoker invoker, IRpcParser parser, IRpcCompressor compressor, ILogger logger, IRpcRouteProvider routeProvider ) : System
serverConfig IOptions Configuration data for the server
invoker IRpcInvoker Component that invokes Rpc requests target methods and returns a response
parser IRpcParser Component that parses Http requests into Rpc requests
compressor IRpcCompressor Component that compresses Rpc responses
logger ILogger Component that logs actions from the router
routeProvider IRpcRouteProvider Provider that allows the retrieval of all configured routes
Результат System