Giter Site home page Giter Site logo

Comments (5)

jhecking avatar jhecking commented on August 23, 2024 2

The info method works as designed, i.e. it returns the requested info per each cluster node through the callback method as soon it is received by the client. Note that the method also has an additional, 2nd callback, which is called once all the nodes have responded:

Client.prototype.info = function (request, host, policy, infoCb, doneCb) { ... }

See the API docs for the full method signature.

But I get how this behavior be a bit unexpected and that for many use cases it would be more convenient to have all the info returned in a single callback. I'll consider this a feature request for a future update. A pull request would be welcome as well. :-)

from aerospike-client-nodejs.

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

Hi @woozyking

Are you still facing the issue, I tried to reproduce this and could not. Please do share the code snippet if you are facing this issue.

Thanks

from aerospike-client-nodejs.

woozyking avatar woozyking commented on August 23, 2024

@GayathriKaliyamoorthy I think the code snippet would still be the same I posted above. If it can no longer be reproduced by you using async library, then this should be good to be closed.

I no longer do this check though on our Aerospike cluster, but just a simple connectivity test.

To me client.info('statistics') seemed more appropriate to be client.on('statistics', function(...) {...}) with the original behavior I posted this issue about, at least less confusing. I'm not entirely sure about the new behavior now, but I appreciate your help.

from aerospike-client-nodejs.

ameykpatil avatar ameykpatil commented on August 23, 2024

I recently faced the same issue (with node.js client version 2.2.0)
I wanted a count of records in a set, so I was calling
client.info('sets/test/testset', callback) (& then parsing to get n_objects)
I was getting callback already called error when using the multi-node cluster but was working fine on a single node cluster.

from aerospike-client-nodejs.

jhecking avatar jhecking commented on August 23, 2024

I've added a new Client#infoAll method, which queries all the cluster nodes and returns the results in a single callback method call. This will be included in the next release, which is tentatively scheduled for next week.

from aerospike-client-nodejs.

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.