Exemplo n.º 1
0
 public AsyncProcessor(IAsync iAsync, ILogger <AsyncProcessor> logger = default)
 {
     _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
     _logger = logger;
     processMap_["emitZipkinBatch"] = emitZipkinBatch_ProcessAsync;
     processMap_["emitBatch"]       = emitBatch_ProcessAsync;
 }
Exemplo n.º 2
0
 public AsyncProcessor(IAsync iface)
 {
     iface_ = iface;
     processMap_["ShowInGameOverlay"] = ShowInGameOverlay_ProcessAsync;
     processMap_["TakeScreenShot"]    = TakeScreenShot_ProcessAsync;
     processMap_["VideoCapture"]      = VideoCapture_ProcessAsync;
 }
Exemplo n.º 3
0
 public Task <IAsync> IAsyncAsync(IAsync input, CancellationToken cancellationToken = default)
 {
     return(Task.FromResult(new IAsync()
     {
         Foo = input.Foo
     }));
 }
 public AsyncProcessor(IAsync iAsync, ILogger <AsyncProcessor> logger = default)
 {
     _iAsync               = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
     _logger               = logger;
     processMap_["Get"]    = Get_ProcessAsync;
     processMap_["GetAll"] = GetAll_ProcessAsync;
 }
Exemplo n.º 5
0
 public AsyncProcessor(IAsync iAsync, ILogger <AsyncProcessor> logger = default)
 {
     _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
     _logger = logger;
     processMap_["InsertFromKafka"]  = InsertFromKafka_ProcessAsync;
     processMap_["SendNotification"] = SendNotification_ProcessAsync;
 }
Exemplo n.º 6
0
 public AsyncProcessor(IAsync iAsync, ILogger <AsyncProcessor> logger = default)
 {
     _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
     _logger = logger;
     processMap_["startTrace"] = startTrace_ProcessAsync;
     processMap_["joinTrace"]  = joinTrace_ProcessAsync;
 }
Exemplo n.º 7
0
        public IProxy executeProxy(string proxyName, string eventType, object data = null)
        {
            IProxy proxy = getProxy(proxyName);

            if (proxy == null)
            {
                return(null);
            }

            if (proxy is IAsync)
            {
                IAsync async = proxy as IAsync;
                if (!async.isReady)
                {
                    async.addReayHandle(delegate(EventX msg)
                    {
                        executeProxy(proxyName, eventType, data);
                    });
                    async.startSync();
                    return(proxy);
                }
            }

            MethodInfo handle;

            if (ReflectionAccessor.TryGetMethod(proxy, eventType, out handle))
            {
                handle.Invoke(proxy, new object[] { data });
                return(proxy);
            }

            proxy.execute(eventType, data);
            return(proxy);
        }
Exemplo n.º 8
0
 public AsyncProcessor(IAsync iAsync, ILogger <AsyncProcessor> logger = default)
 {
     _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
     _logger = logger;
     processMap_["getDependenciesForTrace"] = getDependenciesForTrace_ProcessAsync;
     processMap_["saveDependencies"]        = saveDependencies_ProcessAsync;
 }
Exemplo n.º 9
0
        protected void preViewReadyHandler(EventX e)
        {
            if (e != null)
            {
                IPanel panel = e.target as IPanel;
                panel.removeEventListener(EventX.READY, preViewReadyHandler);
            }

            if (_view.isShow)
            {
                stageHandler(new EventX(EventX.ADDED_TO_STAGE));
            }
            bindSetViewEvent(_view, true);

            if (_model == null)
            {
                mediatorReadyHandle();
                return;
            }

            if (_model is IAsync)
            {
                IAsync asyncModel = _model as IAsync;
                if (asyncModel.isReady == false)
                {
                    _model.addEventListener(EventX.READY, preModelReadyHandle);
                    asyncModel.startSync();
                    return;
                }
            }
            mediatorReadyHandle();
        }
Exemplo n.º 10
0
        public IMediator toggleMediator(string mediatorName, int type = -1)
        {
            IMediator mediator = getMediator(mediatorName);

            if (mediator == null)
            {
                return(null);
            }

            if (mediator is IAsync)
            {
                IAsync async = mediator as IAsync;
                if (async.isReady == false)
                {
                    async.addReayHandle(delegate(EventX msg)
                    {
                        toggleMediator(mediatorName, type);
                    });
                    async.startSync();
                    return(mediator);
                }
            }
            IPanel view = mediator.getView();

            switch (type)
            {
            case 1:
                if (view.isShow == false)
                {
                    view.show();
                }
                else
                {
                    view.bringTop();
                }
                break;

            case 0:
                if (view.isShow)
                {
                    view.hide();
                }
                break;

            case -1:
                if (view.isShow)
                {
                    view.hide();
                }
                else
                {
                    view.show();
                }
                break;
            }
            return(mediator);
        }
Exemplo n.º 11
0
 public static void Observe(this IAsync async)
 {
     async.Receive(delegate(Result result) {
         if (result.IsError)
         {
             result.Observe();
         }
     });
 }
Exemplo n.º 12
0
        public HbaseRWTest()
        {
            _clientTransport = new TSocketClientTransport(IPAddress.Loopback, 9090);
            TProtocol protocol = new TBinaryProtocol(_clientTransport);

            _client      = new Hbase.Client(protocol);
            _hbaseHelper = new HbaseHelper();
            _HbaseParser = new HbaseParser();
        }
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
            }
Exemplo n.º 14
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["GetLocalPath"] = GetLocalPath_ProcessAsync;
            }
Exemplo n.º 15
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["getStruct"] = getStruct_ProcessAsync;
            }
Exemplo n.º 16
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["TakeScreenShot"] = TakeScreenShot_ProcessAsync;
            }
Exemplo n.º 17
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["GetNotifications"] = GetNotifications_ProcessAsync;
            }
Exemplo n.º 18
0
            public AsyncProcessor(IAsync iAsync) : base(iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["Logout"] = Logout_ProcessAsync;
            }
Exemplo n.º 19
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["SendMsg"] = SendMsg_ProcessAsync;
            }
Exemplo n.º 20
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["GetPlayingUserInfo"] = GetPlayingUserInfo_ProcessAsync;
            }
Exemplo n.º 21
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["Enqueue"] = Enqueue_ProcessAsync;
            }
Exemplo n.º 22
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["HelloWorld"] = HelloWorld_ProcessAsync;
            }
Exemplo n.º 23
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["validateTrace"] = validateTrace_ProcessAsync;
            }
        public AsyncProcessor(IAsync iAsync)
        {
            if (iAsync == null)
            {
                throw new ArgumentNullException(nameof(iAsync));
            }

            _iAsync = iAsync;
            processMap_["notify"] = notify_ProcessAsync;
        }
Exemplo n.º 25
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["submitBatches"] = submitBatches_ProcessAsync;
            }
Exemplo n.º 26
0
        internal static void Run(IEnumerator <IAsync> iterator)
        {
            if (!iterator.MoveNext()) //UI 相关需要把这些放到UI线程上执行
            {
                return;
            }
            IAsync item = iterator.Current;

            item.ExecuteStep(() => AsyncExtensions.Run(iterator));
        }
Exemplo n.º 27
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["getBaggageRestrictions"] = getBaggageRestrictions_ProcessAsync;
            }
Exemplo n.º 28
0
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["getThrottlingConfigs"] = getThrottlingConfigs_ProcessAsync;
            }
Exemplo n.º 29
0
        public AsyncProcessor(IAsync iAsync)
        {
            if (iAsync == null)
            {
                throw new ArgumentNullException(nameof(iAsync));
            }

            _iAsync = iAsync;
            processMap_["lookupByPhoneNumber"] = lookupByPhoneNumber_ProcessAsync;
            processMap_["lookupNearby"]        = lookupNearby_ProcessAsync;
        }
            public AsyncProcessor(IAsync iAsync)
            {
                if (iAsync == null)
                {
                    throw new ArgumentNullException(nameof(iAsync));
                }

                _iAsync = iAsync;
                processMap_["GetToken"]      = GetToken_ProcessAsync;
                processMap_["ValidateToken"] = ValidateToken_ProcessAsync;
            }