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

dpm.replies() doesn't start the list #80

Open
beauremus opened this issue Jun 5, 2024 · 0 comments
Open

dpm.replies() doesn't start the list #80

beauremus opened this issue Jun 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@beauremus
Copy link
Contributor

Describe the bug
I believe the expectation is that dpm.replies() can be called to provide an async generator. I don't think this makes sense if the list isn't started. Right now, this function doesn't ensure that the list is started.

To Reproduce
Steps to reproduce the behavior:

#!/usr/bin/env python3

import sys
import acsys.dpm


async def my_app(con):
    # Setup context
    async with acsys.dpm.DPMContext(con) as dpm:
        # Add acquisition requests
        await dpm.add_entry(0, "M:OUTTMP")

        # This code doesn't work without this next line
        # dpm.start()

        # Process incoming data
        async for evt_res in dpm.replies():
            if evt_res.isReading:
                print(evt_res)
            else:
                print(f"ERROR: {evt_res}")


acsys.run_client(my_app)

This runs but hangs because there are never messages, and we never start the list.

Expected behavior
See above

Environment (please complete the following information):

  • [Python]
@beauremus beauremus added the bug Something isn't working label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant