Beispiel #1
0
        public Task ProcessAsync(ClientMethodInvoke invoke)
        {
            var smartActionInfo = invoke.TryGetSmartActionInfo();
            var reactorClientId = smartActionInfo.ReactorClientId;
            var reactorMethod   = smartActionInfo.ReactorMethod;
            var smartId         = smartActionInfo.SmartActionId;
            var smartResult     = string.Format("{0}, {1}, {2} Processed At Server!", smartId, reactorClientId, reactorMethod);

            invoke.TrySaveSmartActionResult(smartResult);
            return(Task.CompletedTask);
        }
Beispiel #2
0
        public bool ShouldProcess(ClientMethodInvoke invoke)
        {
            var smartActionInfo = invoke.TryGetSmartActionInfo <SmartActionInfo>();

            return(smartActionInfo != null && SimpleReactActionId.MyEquals(smartActionInfo.SmartActionId));
        }
Beispiel #3
0
        ////Scope的上下文切换
        //public Task ChangeScope(ChangeScopeArgs args)
        //{
        //    return _hubEventBus.Raise(new ChangeScopeEvent(this, args));
        //}

        //代表客户端的方法调用,供同步页面等场景使用
        public Task ClientMethodInvoke(ClientMethodInvoke args)
        {
            this.FixScopeIdForContext().FixScopeIdForArgs(args);
            TraceHubContext("ClientMethodInvoke");
            return(_hubEventBus.Raise(new ClientMethodInvokeEvent(this, args)));
        }