watson / tick-id

Give each tick on the Node.js event loop it's own ID
MIT License
12 stars 4 forks source link

insights into how to solve this #1

Open ORESoftware opened 7 years ago

ORESoftware commented 7 years ago

Discovered this library just now. Do you think this library can serve as the best answer to my question: https://stackoverflow.com/questions/40013501/javascript-node-js-event-loop-tick-ids

thanks!

watson commented 7 years ago

Yes that seems like a good fit for that

ORESoftware commented 7 years ago

thanks, do you find that the process.addAsyncListener call

process.addAsyncListener({
  create: noop,
  before: function (context, data) {
    tickId = tickId < MAX_SAFE_INTEGER ? tickId + 1 : 1
  },
  error: noop,
  after: noop
})

is stable and reliable? Ideally for my library, I could add and remove listeners. Do you know if there is a way to remove listeners as well as add them?

ORESoftware commented 5 years ago

@watson I am trying to get this issue on nodejs tracker some backup: https://github.com/nodejs/node/issues/25787