webworkers - initial startup helper

Abierto
#207 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
32/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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')]
Lenguaje dominante
Python
Estrellas
17
Forks
20
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyscript/docs

Todos los issues de pyscript/docs

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.