Skip to content
New issue

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

Doubt on the implementation of close_loop(self, loop) #187

Open
tinylambda opened this issue Mar 28, 2020 · 0 comments
Open

Doubt on the implementation of close_loop(self, loop) #187

tinylambda opened this issue Mar 28, 2020 · 0 comments

Comments

@tinylambda
Copy link

async def close_loop(self, loop):

In the implementation of this method, it's annotation says "Close all connections owned by the pool on the given loop" and the method body is:

    async def close_loop(self, loop):
        """
        Close all connections owned by the pool on the given loop.
        """
        if loop in self.conn_map:
            for conn in self.conn_map[loop]:
                conn.close()
                await conn.wait_closed()
            del self.conn_map[loop]

        for k, v in self.in_use.items():
            if v is loop:
                self.in_use[k] = None

for every connection in self.conn_map[loop] here call conn.close() and await conn.wait_closed() to close the connections manually, and finally del self.conn_map[loop], that's fine.

but for the self.in_use dict, where its key is connection object and v is the loop object, here just set the value of the connection object to None, but not call k.close() and await k.wait_closed(). Is here we don't need to close it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant