Skip to content

How can you implement DAQmx streaming & callback functions using betterproto stubs? #398

Answered by astarche
sjdemartini asked this question in Q&A
Discussion options

You must be logged in to vote

Tough question, thanks!

You can get it to work using aclose the same way the other example uses cancel in wait_for_done. But, I can't figure out a way to get past your "Side Question" without adding a sleep. That's frustrating. Maybe that could be added as a feature to betterproto (not sure how that would work). That project hasn't been very active lately, unfortunately.

The snippet below worked for me. I think you're also correct that you could mix in lower-level calls as an alternative. betterproto wraps grpclib internally.

You could also consider using mypy-protobuf to add type hints to the default protoc gen code. And/or use blocking reads instead of events if that can work for you.

T…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sjdemartini
Comment options

@astarche
Comment options

@sjdemartini
Comment options

Answer selected by sjdemartini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants