{"action":"created","issue":{"url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/7","labels_url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/7/comments","events_url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/7/events","html_url":"https://github.com/mqttjs/mqtt-packet/issues/7","id":116146063,"number":7,"title":"process.nextTick and io.js versions up to 1.7.1","user":{"login":"quentin-ol","id":15086178,"avatar_url":"https://avatars.githubusercontent.com/u/15086178?v=3","gravatar_id":"","url":"https://api.github.com/users/quentin-ol","html_url":"https://github.com/quentin-ol","followers_url":"https://api.github.com/users/quentin-ol/followers","following_url":"https://api.github.com/users/quentin-ol/following{/other_user}","gists_url":"https://api.github.com/users/quentin-ol/gists{/gist_id}","starred_url":"https://api.github.com/users/quentin-ol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentin-ol/subscriptions","organizations_url":"https://api.github.com/users/quentin-ol/orgs","repos_url":"https://api.github.com/users/quentin-ol/repos","events_url":"https://api.github.com/users/quentin-ol/events{/privacy}","received_events_url":"https://api.github.com/users/quentin-ol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-10T16:36:43Z","updated_at":"2015-11-10T17:08:23Z","closed_at":null,"body":"Hello everyone,\r\n\r\nin https://github.com/mqttjs/mqtt-packet/blob/master/writeToStream.js#L10, there is a test based on the string `process.version`. To my understanding, this heuristic guesses if one can pass arguments to `process.nextTick` or if wrapping is necessary, in which case `tickShim` is used: https://github.com/mqttjs/mqtt-packet/blob/master/writeToStream.js#L12 .\r\n\r\nThe shim is necessary for versions of io.js up to 1.7.1 (https://github.com/nodejs/node/pull/1077), versions that the heuristic do not match.\r\n\r\nI don't know if you have any plan on supporting older versions of io.js, I'm myself stuck with this version until nwjs (https://github.com/nwjs/nw.js) releases 0.13  in the stable branch but hot-fixing this shouldn't take too much effort, though (I can initiate a PR if this helps).\r\n\r\nRegards,\r\n\r\nQuentin\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/comments/155489400","html_url":"https://github.com/mqttjs/mqtt-packet/issues/7#issuecomment-155489400","issue_url":"https://api.github.com/repos/mqttjs/mqtt-packet/issues/7","id":155489400,"user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T17:08:23Z","updated_at":"2015-11-10T17:08:23Z","body":"If you can send a PR, that would be awesome :). You can always use v3 in\nthe meantime, it does not use nextTick (but it is way slower!)\nIl giorno mar 10 nov 2015 alle 16:36 Quentin Lampin <\nnotifications@github.com> ha scritto:\n\n> Hello everyone,\n>\n> in https://github.com/mqttjs/mqtt-packet/blob/master/writeToStream.js#L10,\n> there is a test based on the string process.version. To my understanding,\n> this heuristic guesses if one can pass arguments to process.nextTick or\n> if wrapping is necessary, in which case tickShim is used:\n> https://github.com/mqttjs/mqtt-packet/blob/master/writeToStream.js#L12 .\n>\n> The shim is necessary for versions of io.js up to 1.7.1 (nodejs/node#1077\n> <https://github.com/nodejs/node/pull/1077>), versions that the heuristic\n> do not match.\n>\n> I don't know if you have any plan on supporting older versions of io.js,\n> I'm myself stuck with this version until nwjs (\n> https://github.com/nwjs/nw.js) releases 0.13 in the stable branch but\n> hot-fixing this shouldn't take too much effort, though (I can initiate a PR\n> if this helps).\n>\n> Regards,\n>\n> Quentin\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/mqttjs/mqtt-packet/issues/7>.\n>\n"}}