Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

RFC: Add Script Startup Priorities

Abierto
#621 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
lua
Área
tooling

Línea de trabajo

Comienza rastreando el escaneo de inicio de script_manager y el bloque de metadatos que se lee antes de que se inicien los scripts. Define cómo las prioridades, incluido el rango reservado para los scripts del sistema, deben afectar al inicio y al orden de registro de eventos; el trabajo estará terminado cuando se hayan especificado e implementado el comportamiento y el tratamiento de las prioridades conflictivas o ausentes.

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

Descripción

Current script startup order

If scripts are started from a luarc file, then they start in the order they are listed in.

If script_manager is handling startup then it works like this:

  • script manager searches the lua directory for scripts and sorts them alphabetically
  • any lua file in a lib directory is ignored.
  • script_manager ignores itself and doesn't try to start a second copy
  • for each script that's found a check to see if it was running at darktable shutdown is made and if it was running it's started
Why does it matter?

Most lua-scripts rely on events to trigger actions. As each script starts it registers events and they are placed in a table for each event type. When an event is triggered the event is sent to the first script that registered, the script performs it's actions, the event is sent to the second script that registered, etc...

Most of the time the order scripts receive events in is not important. However, sometimes order is important. For instance:

  • Lua has an event called inter-script-communication
  • It can be used for cooperative multi tasking so that a long running script, such as cache generation, doesn't block the rest of the lua-scripts until it completes.
  • In the case of cooperative multitasking, the scheduler task should start first so that it doesn't have to wait for for each script to look at the event before getting to the scheduler. Or if I'm debugging the communications, then I would want the debugging script to start first so that it could show the communication before the action takes place.
Possible solutions
  • Dependencies - This was my first thought, but I think this would be a nightmare from building a dependency tree to ending up with circular dependencies.
  • Priorities - Much easier to implement. Much less prone to error. Dependencies probably offer finer control, but I'm not sure it's necessary.
Implementation

We already have a metadata block that is read before starting the script, so that would be the easiest, cleanest solution. A certain block of priorities should be reserved for "system"scripts such as scheduler.

Lenguaje dominante
Lua
Estrellas
220
Forks
141
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 darktable-org/lua-scripts

Todos los issues de darktable-org/lua-scripts

Issues similares

Más issues de Lua

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.