8000 Implement Generalized Aspects by adamgfraser · Pull Request #5006 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement Generalized Aspects #5006

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

Merged
merged 8 commits into from
May 29, 2021
Merged

Implement Generalized Aspects #5006

merged 8 commits into from
May 29, 2021

Conversation

adamgfraser
Copy link
Contributor

No description provided.

@adamgfraser adamgfraser requested a review from iravid as a code owner April 22, 2021 17:32
@adamgfraser adamgfraser requested a review from jdegoes May 20, 2021 23:38
@adamgfraser
Copy link
Contributor Author

@jdegoes Generalized this to include lower and upper bounds. I think we need both for error handling aspects like retry since we may need an upper bound on the error type we can handle. I also found an interesting use for bounds on the value type with MetricAspect where certain metric aspects will place a constraint on the return type of the effect they can be applied to (e.g. it only makes sense to add a Double value to a histogram).

def apply[R >: LowerR <: UpperR, E >: LowerE <: UpperE, A >: LowerA <: UpperA](zio: ZIO[R, E, A]): ZIO[R, E, A]
}

object ZAspect {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Companion object should be the same name as the trait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now!

@jdegoes
Copy link
Member
jdegoes commented May 25, 2021

The stream aspect wholly subsumes ZPipeline, I think, so we can deprecate / remove that. ❤️

@jdegoes jdegoes merged commit f252f4f into zio:series/2.x May 29, 2021
@adamgfraser adamgfraser deleted the aspect branch June 2, 2021 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0