INNER CODE UNIT · Python
wait_response
psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/client.py:255
async def wait_response(self, response_checker, timeout=None):
"""Wait for particular response skipping all intermediate ones.
Useful when you need to need to wait until subscription reports
desired state or skip subscription messages between request and
response.
Args:
response_checker: Function with accepts GraphQL response as
single parameter and must return `True` for desired
response and `False` the other responses.
timeout: Seconds to wait until response is received.
Returns:
Response payload, same as `receive`.
Raises:
`asyncio.TimeoutError` when timeout is reached.