Skip to content

Convert gl-sdk NAPI bindings from Synchronous to Aynchronous calls#669

Closed
ShahanaFarooqui wants to merge 2 commits intoBlockstream:mainfrom
ShahanaFarooqui:gl-sdk-async-napi
Closed

Convert gl-sdk NAPI bindings from Synchronous to Aynchronous calls#669
ShahanaFarooqui wants to merge 2 commits intoBlockstream:mainfrom
ShahanaFarooqui:gl-sdk-async-napi

Conversation

@ShahanaFarooqui
Copy link
Collaborator

In the initial implementation, I overlooked adding asynchronous handling to all I/O-bound NAPI bindings. Since gl-sdk exposes a synchronous Rust API, we use tokio::task::spawn_blocking instead of native async/await. This ensures blocking operations are offloaded to a thread pool and do not impact the Node.js event loop.

  • Breaking Changes: All affected methods now return a Promise on the JavaScript side. Callers must update their usage to await these methods.
  • Additional Changes: Adds the missing bindings-typescript task.

Continued after:
Add TypeScript support via N-API (#659)

@ShahanaFarooqui
Copy link
Collaborator Author

Closing because these commits are already covered in #667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments