Giter Site home page Giter Site logo

why close does not exit? about nsq.js HOT 5 CLOSED

guotie avatar guotie commented on June 27, 2024
why close does not exit?

from nsq.js.

Comments (5)

juliangruber avatar juliangruber commented on June 27, 2024

i can reproduce, investigating

from nsq.js.

juliangruber avatar juliangruber commented on June 27, 2024

nsq.js doesn't queue ops when the connection isn't ready yet, thus listen to the ready event:

var nsq = require('nsq.js');

var writer = nsq.writer('10.10.133.80:4150');
writer.once('ready', function(){
  writer.publish('urlitems', "www.sina.com.cn");
  console.log("ok.");
  writer.close();
});

from nsq.js.

guotie avatar guotie commented on June 27, 2024

thanks.

document it in the readme is better.

from nsq.js.

juliangruber avatar juliangruber commented on June 27, 2024

@visionmedia what's your plan for this?

from nsq.js.

tj avatar tj commented on June 27, 2024

probably just leave it as-is for now (with docs), maybe buffer some day but if a connection goes down and we buffer our latency could be pretty awful, almost better to just respond with an error until things are fine, or we could have a bunch of timeouts etc but that would probably be over-engineering for now

from nsq.js.

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.