You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Have you read the Contributing Guidelines on issues?
Description
To allow the
state_handler
andmessage_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:
asyncio
,trio
,curio
. If possible, it would be ideal to support all of these.ContextVar
(if used)Self-service
The text was updated successfully, but these errors were encountered: