Skip to content

Feature Request: Expose FutureSnapshot in NAPI-RS to enable concurrent asyncio in JS/WASM #202

@runyaga

Description

@runyaga

Feature Request: Expose FutureSnapshot in NAPI-RS to Enable Concurrent asyncio in JS/WASM

tl;dr - I do not need this feature right now, I can make do with sync API. I will likely need this by mid-Q3.

It would be great to know if your not planning to expose to WASM and that isnt a priority AT ALL. That would grealy help.

Overview

I am working inside of a Flutter project which targets both Web (WASM) & Native (iOS, OSX, Windows, etc).
We are executing python scripts generated by the LLM on the client side[0]. Synchronous API for Python works
across both WASM and Native. The Asynchronous API only works for Native. According to the AI its related
to the fact that FutureSnapshot is not exposed in JS/WASM bindings.

Problem Statement

I am unable to execute parallel async operations in Dart over WASM. An example; I can't asyncio.gather multiple fetch calls, for instance. I am hoping to execute async calls to gather device metrics, some metrics take longer than others on the client. And I would prefer to keep this isolated inside the monty/dart boundary instead of hoisting it up higher in my stack. This problem doesnt exist in the NATIVE wrapper.

[0] Dart unlike Python/Javascript has no runtime reflection available and everything is done at compile time. Monty seems like a great way to script in the traditional sense the application. But also in my case LLMs are generating the scripts. Data on the device can not leave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions