-
Notifications
You must be signed in to change notification settings - Fork 2
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
Verify/Fix Resource Management #35
Comments
Maybe it makes more sense to users to be able to manually start and stop the DPM connection. I think the context is still useful. We can require the use of the context to access I haven't thought this through thoroughly. |
Python's Our For instance, I'm concerned that a script leaves the We could use the |
A little clarification of my previous comment is in order.
We can't detect when someone leaves or enters a This means scripts can manage the connection outside of a |
2c1a90c is my proposed fix for this issue. |
|
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-loop
should do an underlyingdpm.start()
and exiting should dodpm.stop()
? At any rate, leaving the loop shouldn't harm the connection state.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-loop
is 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.
The text was updated successfully, but these errors were encountered: