Giter Site home page Giter Site logo

Comments (3)

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

Hi,

client.close() should be invoked only when all the operations that are performed using the client object is completed. The semantics of client.close() is release all the resource associated with client object. The resources include all the open connections and memory allocated for the client object. Once these resources are released, the client can no longer communicate with Aerospike Server and thus the processing stops.

In the above code snippet, you are not waiting for callback to be invoked by the client.batchGet(tweet_keys,function(terr,tresults){} for this batchGet invocation. The client.close() function must be invoked after processing this inner callback.

Thanks.

from aerospike-client-nodejs.

denisbetsi avatar denisbetsi commented on August 23, 2024

Absolutely, I realize that. I am just saying that, those call backs in the forloop do not get terminated, the code gets stuck in the forever unending dead end. If the connection drops for whatever reason and has similar functionality to client.close() will it mean that worker with all those unresolved call backs be stuck the same way?

from aerospike-client-nodejs.

GayathriKaliyamoorthy avatar GayathriKaliyamoorthy commented on August 23, 2024

@denisbetsi

Regarding the connection dropping for any reason, the underlying driver handles that case. Client object stores the callback passed for the batchGet API and invokes it when the operation is completed. If the client object is destroyed, then the behavior is undefined.

Thanks

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.