C# Класс MSA.Zmq.JsonRpc.Worker

Наследование: JsonRpcZmqBase
Показать файл Открыть проект

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

Метод Описание
AddRequestProcessor ( IRequestProcessor processor ) : void

Add the pre-processor for request, for example the authentication processor

AddTaskHandler ( TaskHandlerDescriptor taskHandlerDescriptor ) : void
AddTaskHandler ( object taskHandlerDescriptorInstance, string endpointPrefix ) : void
BeginSuspend ( ) : void
Create ( string address, uint servicePort, ZmqContext context = null ) : Worker
Create ( string address, uint servicePort, string workerId, ZmqContext context = null ) : Worker
EndSuspend ( ) : void
GetAvailableTasks ( ) : IList
RemoveAllResolvers ( ) : void
SetMethodCallAuthorizer ( IMethodCallAuthorizer methodCallAuthorizer ) : void
SetMethodCallLogger ( IMethodCallLogger methodCallLogger ) : void
Start ( ) : void

Loop threads for publisher and replyer

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

Метод Описание
AuthorizeMethod ( JsonRpcRequestHeader requestHeader, JsonRpcRequest request, string requiredRoles ) : void
LogMethodCall ( JsonRpcRequestHeader requestHeader, JsonRpcRequest request ) : void

Logs method invocation

OnStarted ( ) : void

Dispatcher for started event

OnStopped ( ) : void

Dispatcher for stopped event

PreprocessRequest ( JsonRpcRequestHeader requestHeader, JsonRpcRequest request ) : void

Any preprocessing could be handled here. E.g decrypt, unzipped etc

ProcessRequest ( JsonRpcRequestHeader requestHeader, string requestJson ) : string

Process the request and all the responses (including errors) will be wrapped in json response The resolver will perform necessary checking against the request based on custom method attributes being requested and request information

StartHandleRequest ( uint port ) : void

Need framing here to separate the JSON data and the command/instruction | COMMAND | HEADER | JSON DATA |

ValidateRequest ( JsonRpcRequest request ) : void
Worker ( string address, uint servicePort, string workerId, ZmqContext context = null ) : System

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

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

Add the pre-processor for request, for example the authentication processor
public AddRequestProcessor ( IRequestProcessor processor ) : void
processor IRequestProcessor
Результат void

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

public AddTaskHandler ( TaskHandlerDescriptor taskHandlerDescriptor ) : void
taskHandlerDescriptor TaskHandlerDescriptor
Результат void

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

public AddTaskHandler ( object taskHandlerDescriptorInstance, string endpointPrefix ) : void
taskHandlerDescriptorInstance object
endpointPrefix string
Результат void

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

public BeginSuspend ( ) : void
Результат void

Create() публичный статический Метод

public static Create ( string address, uint servicePort, ZmqContext context = null ) : Worker
address string
servicePort uint
context ZmqContext
Результат Worker

Create() публичный статический Метод

public static Create ( string address, uint servicePort, string workerId, ZmqContext context = null ) : Worker
address string
servicePort uint
workerId string
context ZmqContext
Результат Worker

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

public EndSuspend ( ) : void
Результат void

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

public GetAvailableTasks ( ) : IList
Результат IList

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

public RemoveAllResolvers ( ) : void
Результат void

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

public SetMethodCallAuthorizer ( IMethodCallAuthorizer methodCallAuthorizer ) : void
methodCallAuthorizer IMethodCallAuthorizer
Результат void

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

public SetMethodCallLogger ( IMethodCallLogger methodCallLogger ) : void
methodCallLogger IMethodCallLogger
Результат void

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

Loop threads for publisher and replyer
public Start ( ) : void
Результат void