Exemplo n.º 1
0
        public RiakResult Read(IRiakCommand command)
        {
            bool done = false;

            do
            {
                MessageCode expectedCode = command.ExpectedCode;
                Type        expectedType = MessageCodeTypeMapBuilder.GetTypeFor(expectedCode);

                int size = DoRead(expectedCode, expectedType);

                RpbResp response = DeserializeInstance(expectedType, size);
                command.OnSuccess(response);

                var streamingResponse = response as IRpbStreamingResp;
                if (streamingResponse == null)
                {
                    done = true;
                }
                else
                {
                    done = streamingResponse.done;
                }
            }while (done == false);

            return(RiakResult.Success());
        }
Exemplo n.º 2
0
        public RiakResult Read(IRiakCommand command)
        {
            bool done = false;

            do
            {
                int    size   = ReadMessageSize(command.ExpectedCode);
                byte[] buffer = null;
                if (size > 0)
                {
                    buffer = ReceiveAll(new byte[size]);
                }

                RiakResp response = command.DecodeResponse(buffer);

                command.OnSuccess(response);

                var streamingResponse = response as IRpbStreamingResp;
                if (streamingResponse == null)
                {
                    done = true;
                }
                else
                {
                    done = streamingResponse.done;
                }
            }while (done == false);

            return(RiakResult.Success());
        }
        public RiakResult Read(IRiakCommand command)
        {
            MessageCode expectedCode = command.ExpectedCode;
            Type        expectedType = MessageCodeTypeMapBuilder.GetTypeFor(expectedCode);

            int size = DoRead(expectedCode, expectedType);

            RpbResp response = DeserializeInstance(expectedType, size);

            command.OnSuccess(response);

            return(RiakResult.Success());
        }