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

Information on callback execution #651

Open
gabcavic opened this issue Oct 29, 2024 · 2 comments
Open

Information on callback execution #651

gabcavic opened this issue Oct 29, 2024 · 2 comments

Comments

@gabcavic
Copy link

Hi,
I am building an application including real-time streaming of data from the DAQ. I would need some information on the execution models of callbacks such as those provided to functions register_every_n_samples_acquired_into_buffer_event. What happens when the task is running and this callback is executed? Is there a parallel thread launching the event and executing the callback? Is it a blocking execution?

I couldn't find anything in the documentation, but since the execution model in Python can be various (multiprocessing, asynchronous, thread-based, etc) it would be nice to have some clarification on this point.

@zhindes
Copy link
Collaborator

zhindes commented Oct 29, 2024

The implementation is this:

You can see that we pass 0 for the options parameter in task.py. The documentation says

The callback function is called in a DAQmx thread. This is the default value.

If this is useful, feel free to make a PR to task.py to update the documentation! If there are more questions you have, let me know. I can dig into the internal code deeper.

@gabcavic
Copy link
Author

gabcavic commented Nov 1, 2024

THank you very much for the answer! As soon as I will have a bit of time I will prepare the PR

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

2 participants