示例#1
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);
        }
示例#2
0
        public void Notify(string route, int timeout, IMessage msg)
        {
            var serializer = PitayaBinding.ClientSerializer(_client);

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