Git Product home page Git Product logo

Comments (5)

debasishg avatar debasishg commented on July 28, 2024

The outermost Option is for the situation when we get an error reply from Redis server. Please have a look at http://redis.io/topics/protocol.

from scala-redis.

abond avatar abond commented on July 28, 2024

Yep! I should have read Protocol specification before. Sorry!
Now everything clear to me.

from scala-redis.

abond avatar abond commented on July 28, 2024

I've tried to execute "smembers" on key that is not a Set and get Exception: ERR Operation against a key holding the wrong kind of value.
Now I am really confused, because You told that:

The outermost Option is for the situation when we get an error reply from Redis server.

But in fact You fire the exception.
Can You explain this to me, please?

from scala-redis.

debasishg avatar debasishg commented on July 28, 2024

In Redis protocol, some of the APIs return a Multi Bulk Protocol, which is documented in http://redis.io/topics/protocol. If you go towards the end of this document, you will see a discussion on Null Multi Bulk Reply. It says ..

Also the concept of Null Multi Bulk Reply exists.
For instance when the BLPOP command times out, it returns a Null Multi Bulk Reply, that has a count of -1 as in the following example:
C: BLPOP key 1
S: *-1\r\n

Note here redis returns -1 after the MULTI (*). In such cases the client returns a None. The Redis protocol documentation contains this example with BLPOP. But there can be scenarios with other multi-bulk replies where -1 is returned after a MULTI. Hence for safety I have made this distinction.

from scala-redis.

abond avatar abond commented on July 28, 2024

Thank You!

from scala-redis.

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.