Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Using wstd from another event loop on WASI 0.2, without block_on

Offen
#166 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
30/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Aktiv
Tech-Stack
rust, wasm

Rechercherichtung

Start by reproducing the panic when wstd futures are created or polled from GPUI tasks during the exported tick function, using the embedded_gpui and wasm32-wasip2 context described here. Read wstd's runtime and reactor integration alongside GPUI's executor; done would require an agreed, supported way to use http::Client, net::TcpListener, or timers without blocking block_on.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

We run GPUI (Zed's UI framework) inside a wasm32-wasip2 component, through embedded_gpui. The host drives the component by calling an exported tick function repeatedly. Each call runs GPUI's executor until it is idle and must return promptly: the plugin's UI has to keep responding, and the host enforces a time budget per call.

Plugin code, running as GPUI tasks, wants to await wstd's I/O: http::Client, net::TcpListener, timers.

Outside block_on this panics as soon as a wstd future is created or
polled:

Reactor::current must be called within a wstd runtime

block_on isn't usable here. It holds the thread until the future completes, so the UI freezes for the whole request, and the call can outlive the host's time budget. Long waits, such as an OAuth redirect listener waiting for the user to finish signing in in their browser, can't be done at all.

So there is no way to use wstd from a component whose thread belongs to another event loop. Is there a supported way to do this, or would you be open to adding one?

Vorherrschende Sprache
Rust
Sterne
138
Forks
21
Ø Merge
5 T. 12 Std.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus bytecodealliance/wstd

Alle Issues in bytecodealliance/wstd

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.