Пример #1
0
        void RequestInternal <TResponse, TRequest>(string route, TRequest msg, int timeout, IPitayaSerializer serializer, Action <TResponse> action, Action <PitayaError> errorAction)
        {
            _reqUid++;

            Action <byte[]> responseAction = res => { action(serializer.Decode <TResponse>(res)); };

            _eventManager.AddCallBack(_reqUid, responseAction, errorAction);

            _binding.Request(_client, route, serializer.Encode(msg), _reqUid, timeout);
        }
Пример #2
0
        private void OnRouteInternal <T>(string route, Action <T> action, IPitayaSerializer serializer)
        {
            Action <byte[]> responseAction = res => { action(serializer.Decode <T>(res)); };

            _eventManager.AddOnRouteEvent(route, responseAction);
        }