Giter VIP home page Giter VIP logo

Comments (3)

fppt avatar fppt commented on September 26, 2024

Hi!

Thanks for your interest in the project. First of all let me ask, are the returned values what you expect? I.e. are incr and get returning the correct values, because they should be if not then you may have found a bug which I need to attend to.

Now let me explain the log lines. The log lines are showing what "encoded" responses are being sent back. With incran integer is being sent back as shown here with get a string is being sent back as shown here.

You can see that the encodings for strings and ints are different. This is required by the redis protocol which is defined here. In other words jedis clients expect bulk strings to be prepended with $x where x is the number of characters in the string. That's why the string 5 (gets returns strings in the mocks case) has an encoding of $15. Knowing the returned encoding is useful for me while I dev this tool. Hence the confusing debug line. I will try to make that clearer in the next release.

Does that help?

from jedis-mock.

mpopova-yottaa avatar mpopova-yottaa commented on September 26, 2024

Hi!
Ok, now it makes perfect sense.
Yes, the values returned are exactly what I expect - so there is no issue there.
I was only confused with the "$1" prepended to the expected value.
Now that you explained the protocol - it looks correct, as the length of the response is indeed "1" character.

Thank you for the explanation - and for maintaining such a valuable project!
Marina

from jedis-mock.

fppt avatar fppt commented on September 26, 2024

Cool. Glad that explanation made sense. Thanks for the question and for using the project. I am going to close this issue. If you have any other questions/concerns/suggestions please feel to create another issue.

from jedis-mock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.