-
Notifications
You must be signed in to change notification settings - Fork 52
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
examples: Check for DAQmx event registration errors #928
examples: Check for DAQmx event registration errors #928
Conversation
daqmx is still the only driver that's excluded from the Note that script can also run the examples if you run it locally with a "server url" param. No action required, just pointing out a helpful tool that's not helping here. |
I got |
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
- Extract a check_for_stream_error function. - For non-aio, use stream.exception() to check for errors - For aio, use stream.code() to check for errors because the aio interfaces don't support stream.exception() Signed-off-by: Brad Keryan <brad.keryan@ni.com>
782dab1
to
5fc9c53
Compare
grpc-stubs doesn't treat the object returned from a UnaryStreamMultiCallable as a Future. shabbyrobe/grpc-stubs#41 Signed-off-by: Brad Keryan <brad.keryan@ni.com>
What does this Pull Request accomplish?
Change the DAQmx event examples to explicitly check for stream errors after waiting for initial metadata.
If the stream was closed with an error, it is "done" and reading a response will throw an exception.
Why should this Pull Request be merged?
Demonstrates how to benefit from #927
What testing has been done?
Tested examples as written.
Tested error handling by changing
EVERY_N_SAMPLES_EVENT_TYPE_ACQUIRED_INTO_BUFFER
toEVERY_N_SAMPLES_EVENT_TYPE_TRANSFERRED_FROM_BUFFER
and adding areturn
after the error check to prevent the worker thread/async task from being started.