-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
ZQuery Improvements #200
ZQuery Improvements #200
Conversation
All set. |
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.
Thanks!
* and then combining the values to produce a summary, together with the | ||
* result of execution. | ||
*/ | ||
final def summarized[R1 <: R, E1 >: E, B, C](f: (B, B) => C)(summary: ZIO[R1, E1, B]): ZQuery[R1, E1, (C, A)] = |
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.
Shall we switch the parameters here too?
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.
Yes. I was slightly inclined to wait until RC18 and make conforming changes to that so we track the public ZIO API for identical methods but happy to change now as well.
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.
Ah ok, either way's fine 👍
Improvements to ZQuery based on recent suggestions:
summarized
andtimed
methods on ZQuery analogous to existing methods on ZIO. These do not interfere with query batching.fromRequestOption
constructor on ZQuery to construct queries that returnNone
instead of failing with aQueryFailure
if a data source does not return a result for a request. ImplementsfromFunctionOption
,fromFunctionOptionM
,fromFunctionBatchedOption
, andfromFunctionBatchedOptionM
to create data sources that may not return a result for a request.fromFunctionBatchedWithM
now also allows you to use an effect that can fail. If the effect fails the failure will be returned for all requests.