Giter Site home page Giter Site logo

Comments (7)

fictorial avatar fictorial commented on July 20, 2024

I am away from a usable computer ATM (on my iPhone) but I think you get back a Buffer object. Try calling toString on message .

from redis-node-client.

michaelsbradleyjr avatar michaelsbradleyjr commented on July 20, 2024

Thanks for the tip -- it works! I thought I had tried that very thing the other day, but perhaps I had mistakenly stuck the toString() function on the end of the wrong variable, i.e. it didn't seem to help.

Is there a "cheat sheet" or a easy way to remember which constructs will be synchronous and which won't be? I'm assuming here that calling toString() blocks the JSON.parse call until the buffer has been emptied into the stringified version of the message variable.

from redis-node-client.

fictorial avatar fictorial commented on July 20, 2024

Any operation that performs I/O is asynchronous. Any other operation is synchronous. Thus, calling toString on a Buffer is synchronous. However, it does nothing other than convert the bytes in the buffer to a String with the given encoding -- it does not "block" per se.

from redis-node-client.

michaelsbradleyjr avatar michaelsbradleyjr commented on July 20, 2024

Thanks, the insights are much appreciated, as is your redis-node-client library.

from redis-node-client.

fictorial avatar fictorial commented on July 20, 2024

I'm glad to help!

from redis-node-client.

michaelsbradleyjr avatar michaelsbradleyjr commented on July 20, 2024

By the way, this great piece of code has been performing well too. In some tests I've conducted I've been pushing ~20,000 requests per second, spread across four instances of your redis client (two per node.js process). Bandwidth has been upwards of 40+ Mbps. Very nice!! Thanks again, and please keep up the great work. ;-D

from redis-node-client.

fictorial avatar fictorial commented on July 20, 2024

Great! Stress-testing is something that I haven't done myself so this is great to hear.

from redis-node-client.

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.