We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
we've got an error when the conection / initialization is still ongoing: https://github.com/jonathanslenders/asyncio-redis/blob/master/asyncio_redis/protocol.py#L832
we cannot be sure that this task is finished before starting to talk to redis (for instance, reading a pubsub), so our code ends at https://github.com/jonathanslenders/asyncio-redis/blob/master/asyncio_redis/protocol.py#L664.
Is there a way to not set an asyncio.sleep() and let us know if we're correctly connected to redis ?
Thank you.
The text was updated successfully, but these errors were encountered:
What I have been using so far to make sure I connect to services like Redis is asyncio.wait_for.
asyncio.wait_for
Here is an example of how I make sure I'm connected:
async def connect(): connection_made = False while not connection_made: try: connection = await asyncio.wait_for(asyncio_redis.Pool.create( host='localhost', port=6379, poolsize=20, db=0), 3.0) connection_made = True except asyncio.TimeoutError: print('having trouble connecting to redis') # let's try again continue print('connected to redis')
Sorry, something went wrong.
Well, Pool.create has the same pattern, that uses asyncio.async or such, which is the same pattern :(
Pool.create
asyncio.async
https://github.com/jonathanslenders/asyncio-redis/blob/master/asyncio_redis/connection.py#L64
Still, the future will be never consumed.
No branches or pull requests
Hello,
we've got an error when the conection / initialization is still ongoing: https://github.com/jonathanslenders/asyncio-redis/blob/master/asyncio_redis/protocol.py#L832
we cannot be sure that this task is finished before starting to talk to redis (for instance, reading a pubsub), so our code ends at https://github.com/jonathanslenders/asyncio-redis/blob/master/asyncio_redis/protocol.py#L664.
Is there a way to not set an asyncio.sleep() and let us know if we're correctly connected to redis ?
Thank you.
The text was updated successfully, but these errors were encountered: