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

Add duration parameter to run method in DataStream #492

Open
1 task done
hnewey7 opened this issue Aug 5, 2024 · 0 comments
Open
1 task done

Add duration parameter to run method in DataStream #492

hnewey7 opened this issue Aug 5, 2024 · 0 comments

Comments

@hnewey7
Copy link

hnewey7 commented Aug 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

I wanted to create a unit test where I track an instrument for a period of time and then stop it to go and check if the data has been processed correctly. However I could only see the keyboard interrupt and I think it would be good to have a parameter where you can allow the instrument to run for a certain amount of time. This could then be used for syncing up with opening hours of the instrument so you're not unnecessarily running a script.

Describe the solution you'd like.

A simple parameter in the run method that allows you to enter a duration, this could be in the form of a datetime time delta object. You then start two tasks running with the asyncio library, one being the data collection and the other being a timer to check if the duration has been exceeded. The two tasks will then return whichever one finishes first which in this case will be the timer as the other task loops indefinitely.

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

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