RFC: Add Script Startup Priorities
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de darktable-org/lua-scripts
-
dtutils.string: build_substitute_list errors when a metadata field (e.g. rights) has been removedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
darktable-org/lua-scripts#716 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
darktable-org/lua-scripts#706 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
darktable-org/lua-scripts#627 · 2 comentarios ·
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
darktable-org/lua-scripts#618 · 3 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
darktable-org/lua-scripts#710 · 3 comentarios ·
Todos los issues de darktable-org/lua-scripts
Issues similares
-
omarchy-menu-keybindings lua bind scan spins at 100% CPU when user config iterates a mocked hl APIAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
omacom/omarchy#14302 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
PathOfBuildingCommunity/PathOfBuilding-PoE2#2560 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Nevcairiel/GatherMate2#62 ·
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100