opendal icon indicating copy to clipboard operation
opendal copied to clipboard

migrate to nodejs's native iterator API when `napi-rs` is ready

Open suyanhanx opened this issue 1 year ago • 2 comments

We rely heavily on napi-rs to implement our functions.

The following APIs are still in some sort of simulation and will be migrated to the native implementation when napi-rs is ready.

  • [ ] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator
  • [ ] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator

Also see https://github.com/datafuselabs/opendal/issues/1525#issuecomment-1461494776

napi-rs side

  • napi-rs/napi-rs/issues/1493

suyanhanx avatar Mar 09 '23 08:03 suyanhanx

Is there an issue on the napi-rs side? We can link to this page to let them know that we have a demand for this feature.

Xuanwo avatar Mar 09 '23 08:03 Xuanwo

Updated with current napi-rs's RFC 3.0.

suyanhanx avatar Mar 09 '23 09:03 suyanhanx

list should return Vec<Entry> now. @suyanhanx, would you like to change the API of opendal-nodejs?

Xuanwo avatar Dec 19 '23 04:12 Xuanwo

list should return Vec<Entry> now. @suyanhanx, would you like to change the API of opendal-nodejs?

I'll handle this.

suyanhanx avatar Dec 19 '23 04:12 suyanhanx

Plan to implement the System.iterator on the js side. Close this issue now.

suyanhanx avatar Dec 19 '23 15:12 suyanhanx