Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#166 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 5 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
30/100
Type d'issue
Fonctionnalité
Clarté
À clarifier
Activité
Active
Stack technique
rust, wasm

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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?

Langage dominant
Rust
Étoiles
136
Forks
21
Merge moyen
5 j 6 h
PR mergées (30 j)
11

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de bytecodealliance/wstd

Toutes les issues de bytecodealliance/wstd

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.