Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Async state and message handler

Aperta
#1,005 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

  • #1411 di @Nikhil172913832 — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
testing-qa

Direzione di ricerca

Inizia individuando i punti di ingresso state_handler e message_handler e leggendo come vengono attualmente invocate le funzioni sincrone. Confronta i requisiti di asyncio, trio e curio, inclusi ContextVar e le implicazioni per i thread; il lavoro è completo quando gli handler asincroni supportati funzionano senza compromettere gli handler sincroni esistenti e sono coperti da test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:core difficulty:medium type:feature
Have you read the Contributing Guidelines on issues?
Description

Original suggestion by Val on Slack

To allow the state_handler and message_handler functions to handle asynchronous functions.

Motivation

These two functions are used to interface with code outside of Pact Python to setup/teardown states and generate messages. Especially in the case of the state setup and teardown, a common pattern would be to make a number of calls to (mocked or not) databases or other services to ensure they are in a particular state. These requests can be significantly sped up by running them in parallel, such as with an asyncio.gather call or using a task group.

Have you tried building it?

Not yet, but I will first open this issue and ask for anyone with specific examples to work towards.

While asynchronous function bring a number of advantages, they can also bring some complications. In particular:

  • There are a number of underlying runtimes: asyncio, trio, curio. If possible, it would be ideal to support all of these.
  • The use of threads has implications for ContextVar (if used)
Self-service
  • I'd be willing to contribute this feature to Pact Python myself.
Lingua principale
Python
Stelle
685
Fork
147
Merge medio
4g 8h
PR unite (30g)
14

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pact-foundation/pact-python

Tutte le issue di pact-foundation/pact-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.