Skip to content

readexactly() called while another coroutine is already waiting for incoming data #715

Answered by Nothing4You
timotei-za asked this question in Q&A
Discussion options

You must be logged in to vote

hi,

your example only shows a single request, can you provide an example that fails?

also, I'm not sure what you're trying to do in your example.
why would you use a connection pool if you only retrieve a single connection and then close the pool?

even then, with minor adjustments to get your code into a runnable state, this works fine for me:

import asyncio

import aiomysql


pool = None


# create pool connection
async def create_pool():
    print("Creating pool connection...")
    global pool

    pool = await aiomysql.create_pool(
        host="127.0.0.1",
        port=3306,
        user="root",
        password="rootpw",
        db="mysql",
        autocommit=True
    )


async def g…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Nothing4You
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #639 on January 30, 2022 09:26.