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

AsyncIoStream method wait_closed() raises attribute error #365

Open
mwilliamson-fourier opened this issue Sep 4, 2024 · 0 comments
Open

Comments

@mwilliamson-fourier
Copy link

When using AsyncIoStream, I've tried to use wait_closed() after closing the connection. However, doing so results in an error since it seems like a non-existent attribute is being referenced:

  File "/tmp/a/capnp-async-connection.py", line 12, in main
    await connection.wait_closed()
  File "capnp/lib/capnp.pyx", line 2414, in wait_closed
AttributeError: 'capnp.lib.capnp._PyAsyncIoStreamProtocol' object has no attribute 'closed_future'

The below should be a fairly minimal reproduction of the issue, assuming there's a server running on the relevant hostname and port:

import asyncio

import capnp

async def main():
    async with capnp.kj_loop():
        connection = await capnp.AsyncIoStream.create_connection(
            host="127.0.0.1",
            port=8000,
        )

        connection.close()
        await connection.wait_closed()


asyncio.run(main())

Am I using wait_closed() incorrectly, or is this a bug in pycapnp?

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