Ejemplo n.º 1
0
        public void Request(string route, string msg, int timeout, Action <string> action, Action <PitayaError> errorAction)
        {
            _reqUid++;
            Action <object> responseAction = res => { action((string)res); };

            _eventManager.AddCallBack(_reqUid, responseAction, errorAction);

            PitayaBinding.Request(_client, route, JsonSerializer.Encode(msg), _reqUid, timeout);
        }
Ejemplo n.º 2
0
        public void Request <T>(string route, IMessage msg, int timeout, Action <T> action, Action <PitayaError> errorAction)
        {
            _reqUid++;
            _typeRequestSubscriber.Subscribe(_reqUid, typeof(T));

            Action <object> responseAction = res => { action((T)res); };

            _eventManager.AddCallBack(_reqUid, responseAction, errorAction);

            var serializer = PitayaBinding.ClientSerializer(_client);

            PitayaBinding.Request(_client, route, ProtobufSerializer.Encode(msg, serializer), _reqUid, timeout);
        }