baudehlo / node-fs-ext

Extras missing from node's fs module
MIT License
101 stars 45 forks source link

Change EIO_After callback call to use AsyncResource #73

Closed davedoesdev closed 6 years ago

davedoesdev commented 6 years ago

This was causing my tests in qlobber-fsq to hang. I'm having difficulty writing a test to repro here.

The deprecation notice in nan.h says:

  // Deprecated: For async callbacks Use the versions that accept an
  // AsyncResource. If this callback does not correspond to an async resource,
  // that is, it is a synchronous function call on a non-empty JS stack, you
  // should Nan::Call instead.

My initial fix was to use Nan::Call. I believe EIO_After is always used for async callbacks.

The tests still pass.

davedoesdev commented 6 years ago

Fits what Nan's AsyncWorker does (holds an AsyncResource until the callback function completes).

baudehlo commented 6 years ago

Merged, thanks.

baudehlo commented 6 years ago
$ npm publish
+ fs-ext@1.2.0