Пример #1
0
        /// <summary>
        /// The callback will be returned to the user, who needs to invoke it in concrete
        /// service implementation. Call should be made directly from same thread as
        /// service method is executed.
        /// </summary>
        /// <param name="sessionId">Handler session id</param>
        /// <returns></returns>
        public static Action <JsonResponse> GetAsyncProcessCallback(string sessionId = "")
        {
            Handler handler;

            if ("" == sessionId)
            {
                handler = Handler.GetSessionHandler(Handler.DefaultSessionId());
            }
            else
            {
                handler = Handler.GetSessionHandler(sessionId);
            }

            return(handler.GetAsyncCallback());
        }
Пример #2
0
 public static void BindService <T>() where T : new()
 {
     BindService <T>(Handler.DefaultSessionId());
 }
Пример #3
0
 protected JsonRpcService()
 {
     buildService(Handler.DefaultSessionId());
 }
Пример #4
0
 protected JsonRpcService()
 {
     ServiceBinder.BindService(Handler.DefaultSessionId(), this);
 }
 internal static void ProcessJsonRpcState(JsonRpcStateAsync async, object jsonRpcContext = null)
 {
     ProcessJsonRpcState(Handler.DefaultSessionId(), async, jsonRpcContext);
 }
 public static Task <string> Process(string jsonRpc, object context = null)
 {
     return(Process(Handler.DefaultSessionId(), jsonRpc, context));
 }
Пример #7
0
 public void Dispose()
 {
     Handler.DestroySession(Handler.DefaultSessionId());
 }
Пример #8
0
 public static void Process(JsonRpcStateAsync async, object context = null)
 {
     Process(Handler.DefaultSessionId(), async, context);
 }
Пример #9
0
 public static Task <string> Process(JsonRequest request, object context = null)
 {
     return(Process(Handler.DefaultSessionId(), request, context));
 }
Пример #10
0
 public static void AsyncProcess(string jsonRpc, Action <string> callback, object context = null)
 {
     Task.Factory.StartNew(() => AsyncProcessInternal(Handler.DefaultSessionId(), jsonRpc, context, callback));
 }
Пример #11
0
 public static async Task <JsonResponse[]> Process(string jsonRpc, JsonRequest[] jsonRequests, object context = null)
 {
     return(await Process(Handler.DefaultSessionId(), jsonRpc, jsonRequests, context));
 }
Пример #12
0
 public static Task <string> Process(string jsonRpc, object context  = null,
                                     JsonSerializerSettings settings = null)
 {
     return(Process(Handler.DefaultSessionId(), jsonRpc, context, settings));
 }
Пример #13
0
 public static void Process(JsonRpcStateAsync async, object context = null,
                            JsonSerializerSettings settings         = null)
 {
     Process(Handler.DefaultSessionId(), async, context, settings);
 }