Skip to content

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

Description

@beauremus

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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions