Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process doesn't terminate even ZeroMQ socket closed #141

Closed
badwulfy opened this issue May 11, 2017 · 7 comments
Closed

Process doesn't terminate even ZeroMQ socket closed #141

badwulfy opened this issue May 11, 2017 · 7 comments

Comments

@badwulfy
Copy link

badwulfy commented May 11, 2017

No description provided.

@n-riesco
Copy link
Contributor

I've tried an ES5 version of that code on Node v4.2.6, and it works for me:

var zmq = require('zeromq');
var debug = require('debug')('publisher');

var port = '8000';
var subject = 'FLIGHTS';

var socket = zmq.socket('pub');

socket.on('close', function() {
  debug('connection closed');
});

socket.on('close_error', function() {
  debug('error while closing connexion');
});

socket.monitor(10, 0);
socket.bindSync('tcp://*:' + port);

function close() {
  socket.close();
}

setTimeout(close, 3000);

I'd have a look at the output of the transpiler you're using.

@rgbkrk
Copy link
Member

rgbkrk commented May 12, 2017

import zmq from 'zeromq';

We don't expose a default export so you'll want to do import * as zmq from 'zeromq'.

@lgeiger
Copy link
Member

lgeiger commented May 13, 2017

@rgbkrk should we add a default export?

@rgbkrk
Copy link
Member

rgbkrk commented May 13, 2017

If we get another person that runs into this, I could see us doing it. It's a minor bump on a stable library, I'd prefer to save it for a time when it's really necessary. However, if someone makes a PR, I'll still happily merge it in.

@n-riesco
Copy link
Contributor

@rgbkrk Is this possible while keeping compatibility with Node v0.10?

@rgbkrk
Copy link
Member

rgbkrk commented May 13, 2017

module.exports.default = module.exports I think 🤔

@n-riesco
Copy link
Contributor

Looks like a harmless change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants