pyscript / pyscript/docs

webworkers - initial startup helper

Aperta
#207 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
17
Fork
20
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

New docs are looking great. 👍
Was looking through webworkers and thought you might want to add a starter function which might be used when the page starts up to pre-initialise the workers so they are ready sooner.

I took this from a prior code version so it probably needs some refining, updating to 2026.1.1, and to be in a function
but something like this could be useful to add

# start workers but no handles to use and have to wait - so use ltk.schedule instead
for el in window.document.querySelectorAll("[type='py'][worker][name]"):
    print("found",el, el.id)
    print(workers, workers.id, workers.name)
    el.onload(ltk.proxy(lambda e: print("loaded",e)))
    print(dir(el))
    await workers[el.getAttribute('name')]

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start by locating the webworkers documentation entry point and comparing the current 2026.1.1 API with the older snippet in this issue. Determine whether a startup helper belongs in the docs and verify that the documented example matches the current worker-loading behavior; done means the intended pre-initialization guidance is current and usable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.