Skip to main content

Asyncify

non-cncf
First Research Pass

Content Lifecycle & Evolution State

1
Initial Seed
Metadata Loaded
2
First Research
Automated Gathering
3
Tech Writing
Content Structured
4
Approval
Editorial Verified
First Research Pass Completed: Initial facts, key features, and documentation links have been gathered. Detailed technical writing and synthesis are currently in queue.

Overview

A JavaScript wrapper intended to be used with the Asyncify feature of Binaryen. Together, they allow the use of asynchronous APIs (such as most Web APIs) from within WebAssembly written and compiled from any source language.

Key Features

  • JavaScript wrapper for Binaryen’s Asyncify feature.

  • Enables using asynchronous APIs (like most Web APIs) within WebAssembly.

  • Supports drop-in replacement APIs for the regular WebAssembly interface with added async support.

  • Wraps WebAssembly exports into async functions.

Use Cases

Bridging asynchronous JavaScript and Web APIs with synchronous WebAssembly code, particularly when porting existing native C/C++ or Rust applications that make synchronous network requests or blocking operations to the web.

Getting Started

Compile your code to WebAssembly, post-process it using `wasm-opt --asyncify`, and instantiate it in JavaScript using `Asyncify.instantiateStreaming` from `https://unpkg.com/asyncify-wasm?module`.

Recent Updates

The repository was archived by the owner on Jul 8, 2024. It is now read-only.

Did You Know?

Asyncify operates by transforming WebAssembly code post-compilation using wasm-opt from the Binaryen toolchain, enabling it to pause and resume execution.