C# Class EdjCase.JsonRpc.Router.RpcRouter

Router for Asp.Net to direct Http Rpc requests to the correct method, invoke it and return the proper response
Inheritance: IRouter
Afficher le fichier Open project: edjCase/JsonRpc

Private Properties

Свойство Type Description
SetErrorResponse System.Threading.Tasks.Task
SetResponse System.Threading.Tasks.Task

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

GetVirtualPath() public méthode

Generates the virtual path data for the router
public GetVirtualPath ( VirtualPathContext context ) : VirtualPathData
context VirtualPathContext Virtual path context
Résultat VirtualPathData

RouteAsync() public méthode

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
Résultat System.Threading.Tasks.Task

RpcRouter() public méthode

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
Résultat System