abi-stable-node icon indicating copy to clipboard operation
abi-stable-node copied to clipboard

Possible chances to take advantage of libuv stability

Open ghinks opened this issue 6 years ago • 3 comments

Possible chances to take advantage of libuv stability

Use of libuv polling for the more hardware orientated modules is being seen.

Use is being made of libuv to detect events on a file descriptor in existing stable modules. Some of the features that libuv provide could be exposed via NAPI or use of libuv could be allowed in order to avoid complex changes to some modules.

modules looked at that support these cases

github repo description npm wkly downloads thousands
node-serialport arduino serial port driver allowing educational and hoby 23
node-raw-socket module used by net-ping for JS ping utilities 433

Code fragement example

void Poller::poll(int events) {
  this->events = this->events | events;
  int status = uv_poll_start(poll_handle, events, Poller::onData);
  if (0 != status) {
    ...
    return;
  }
}

Code line links

ghinks avatar Feb 07 '19 23:02 ghinks

I would love to see this. uv_poll_t is very useful and not very complex.

reconbot avatar Apr 30 '19 17:04 reconbot

@cjihrig in the event of a libuv-2.0 release, is there danger of the polling API suffering an ABI break?

gabrielschulhof avatar May 06 '19 17:05 gabrielschulhof

Not that I'm aware of, but I'm going to ping @bnoordhuis just in case.

cjihrig avatar May 06 '19 18:05 cjihrig