-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: return result from flow and client #1541
Conversation
This PR closes: #1540 |
1 similar comment
This PR closes: #1540 |
@@ -151,6 +154,8 @@ async def _get_results(self, input_fn: Callable, | |||
'please double check your input iterator') from rpc_ex | |||
else: | |||
raise BadClient(msg) from rpc_ex | |||
if self.args.return_results: | |||
return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to return a generator to make it more general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried. too complicated., async generator is depreciated in python asyncio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, if async generator is desired, why not directly use on_done
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see design decision in PR body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is true. Just a comment that felt more natural, but no big deal
Latency summaryCurrent PR yields:
Breakdown
Backed by latency-tracking. Further commits will update this comment. |
Codecov Report
@@ Coverage Diff @@
## master #1541 +/- ##
==========================================
+ Coverage 84.42% 84.51% +0.09%
==========================================
Files 108 108
Lines 6305 6368 +63
==========================================
+ Hits 5323 5382 +59
- Misses 982 986 +4
Continue to review full report at Codecov.
|
add
return_results
(by default =False
) in client CLI, so that when turning on, results are returned as a list. Can be used withFlow
andAsyncFlow
, e.g.AsyncFlow
:SyncFlow
Design decision:
on_done
callback is sufficient.