temporalio / temporalio/samples-python
[Feature Request] Guide against single-file structure
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 367
- Forks
- 121
- Merge moyen
- 3 j 20 h
- PR mergées (30 j)
- 11
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par hello/hello_activity.py, lignes 47-64, et comparez sa configuration de Worker et de workflow dans un seul fichier avec worker.py et starter.py de l’exemple de chiffrement. Déterminez si les indications doivent figurer dans la structure de l’exemple ou dans les commentaires, puis mettez à jour les exemples concernés afin que des processus Worker et client distincts, avec un Worker servant les workflows, soient clairs et cohérents.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100