temporalio / temporalio/samples-python
[Feature Request] Guide against single-file structure
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 367
- Forks
- 121
- Merge medio
- 3 d 20 h
- PR fusionados (30 d)
- 11
Descripción
Is your feature request related to a problem? Please describe.
Given this single-file pattern of running a Workflow inside a Worker:
there is potential (and one past instance I know of) for people learning based off of samples to think that in order to run a Workflow, you need to run it inside an async with Worker. When they try to develop an application based on that paradigm, they run into a number of issues.
Describe the solution you'd like
Make it clear that when developing, we recommend:
- running a worker separately from workflows
- defaulting to a single worker for all workflows, not one worker per workflow
We could make it clear by structuring all samples that way. OTOH I like the brevity of the single file samples. Another possibility is changing the comment. The drawbacks to that are:
- some people don't read comments
- the comment might not be clear, unless you point to a multi-file sample, what exactly we recommend doing
Comment is currently:
# While the worker is running, use the client to run the workflow and
# print out its result. Note, in many production setups, the client
# would be in a completely separate process from the worker.
Perhaps could be:
# Use the client to run the workflow and print out its result.
# NOTE: when developing, we recommend starting out running a
# single worker that has all your workflow and activities and
# running client code in a separate process. See, for example,
# how the encryption sample has a separate files to run:
# worker.py runs the worker and starter.py uses the client.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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.
Línea de trabajo
Comienza con hello/hello_activity.py, líneas 47-64, y compara su configuración de Worker y workflow en un solo archivo con worker.py y starter.py del ejemplo de cifrado. Decide si las indicaciones deben pertenecer a la estructura del ejemplo o a los comentarios, y luego actualiza los ejemplos relevantes para que los procesos separados de Worker y cliente, con un Worker sirviendo workflows, sean claros y coherentes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100