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
Async with real detector #30
Conversation
To be tested...
I couldn't get this to work, sadly. Will become a bug report.
This fails currently, and I couldn't get it to work with reasonable effort. The root cause is that the context manager to make the connection doesn't work properly. I am not sure how live processing in an async context should be implemented, since we have to read the data in the proper sequence from one socket.
/azp run libertem.libertem-live-data |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
- Coverage 74.00% 73.97% -0.04%
==========================================
Files 14 15 +1
Lines 1208 1241 +33
Branches 142 145 +3
==========================================
+ Hits 894 918 +24
- Misses 276 284 +8
- Partials 38 39 +1
Continue to review full report at Codecov.
|
I think it does make sense to support the I'll have a look at the PR changes next. |
Instead of overriding `run_udf` and `run_udf_iter`, override only `_run_sync`, which is maybe a more convenient place: the `sync=True`, `iterare=True` variant is used in all cases, just more or less wrapped or reduced.
/azp run libertem.libertem-live-data |
Azure Pipelines successfully started running 1 pipeline(s). |
I pushed my changes into your branch, as discussed offline. This should now be a general solution, for all cases, and should thus supersede #29. |
The |
Nice, thank you! 👍 |
/azp run libertem.libertem-live-data |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run libertem.libertem-live-data |
Azure Pipelines successfully started running 1 pipeline(s). |
Regarding the intermittent test failures: @sk1p now has better error handling that will hopefully give better insight on what happens there. We'll merge for now and see what happens! |
Edit: Now closes #29 thanks to fix by @sk1p!
This PR is just a failing test case since I couldn't get it to work properly. It is based on #29
The reason that it fails is that we have to keep the connection until the computation is complete, i.e. until the result is awaited or the async generator consumed. The sync case is fixed in #29.
@sk1p could you have a look? I am not sure how live processing in an async context
should be implemented, since we have to read the data in the proper
sequence from one socket.
Use case for this API would probably be integration in an async GUI application? Or should we not support async at all and throw a
NotImplementedError
ifsync
isFalse
?Contributor Checklist:
Reviewer Checklist:
/azp run libertem.libertem-live-data
passed