-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Issue #34 brings up a point that we may have been cleaning up our resources in the wrong location. This issue was created to track either fixing the problem or verifying it has the proper behavior. Mostly I want to verify correct behavior for the 1.x branch since that's the future of this package. These are the specifications we should meet:
async with DPMContext()will create a connection to a DPM. The state of that connection is maintained by the object returned in the statement (typically we call itdpm). Once this block is exited, all DPM resources are freed.async for ...starts delivering pending and new packets from DPM. If this loop is exited, DPM acquisition should stop. Maybe entering anasync for-loopshould do an underlyingdpm.start()and exiting should dodpm.stop()? At any rate, leaving the loop shouldn't harm the connection state.- When
dpm.stop()is called, the STOP command sent to DPM must have a reply so we know DPM won't send anymore data. Then the library should clear out any pending data so that when a newasync for-loopis started, the data returned is guaranteed to be new.
This allows a script to enter an acquisition loop, leave it to do other stuff, and then enter another one. The DPM flow should start and stop at the appropriate time.
Metadata
Metadata
Assignees
Labels
discussionissue requires discussionissue requires discussion