Skip to content
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

Refactor: Remove type params from HttpData #766

Merged
merged 3 commits into from
Jan 5, 2022

Conversation

tusharmath
Copy link
Collaborator

@tusharmath tusharmath commented Jan 5, 2022

HttpData was unnecessary complex with type-parameters. This also help in our final goal of ultimately removing type-params from Response.

Feature

  • Added fromStream operator to Http

@github-actions github-actions bot added enhancement New feature or request maintenance Chore or Maintenance tasks labels Jan 5, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #766 (ccb4b35) into main (33ec69e) will increase coverage by 0.19%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #766      +/-   ##
==========================================
+ Coverage   49.63%   49.83%   +0.19%     
==========================================
  Files          69       69              
  Lines        2069     2067       -2     
  Branches       52       55       +3     
==========================================
+ Hits         1027     1030       +3     
+ Misses       1042     1037       -5     
Impacted Files Coverage Δ
zio-http/src/main/scala/zhttp/http/Response.scala 69.23% <ø> (ø)
zio-http/src/main/scala/zhttp/service/Client.scala 57.14% <ø> (ø)
...io-http/src/main/scala/zhttp/service/Handler.scala 67.44% <ø> (ø)
zio-http/src/main/scala/zhttp/http/Request.scala 30.00% <50.00%> (+2.72%) ⬆️
zio-http/src/main/scala/zhttp/http/Http.scala 63.24% <100.00%> (+0.63%) ⬆️
zio-http/src/main/scala/zhttp/http/HttpData.scala 52.63% <100.00%> (+9.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33ec69e...ccb4b35. Read the comment docs.

@tusharmath tusharmath removed the enhancement New feature or request label Jan 5, 2022
@tusharmath tusharmath added enhancement New feature or request and removed refactor labels Jan 5, 2022
* Creates a Http that always succeeds with a 200 status code and the provided ZStream as the body
*/
def fromStream[R](stream: ZStream[R, Throwable, Byte]): HttpApp[R, Nothing] =
Http.fromEffect(ZIO.environment[R].map(r => Http.fromData(HttpData.fromStream(stream.provide(r))))).flatten
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure what will be the impact on Performance here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will need to benchmark this. Irrespective of that, in production people will use provide anyways at places.

Tushar Mathur and others added 2 commits January 5, 2022 16:35
@amitksingh1490 amitksingh1490 merged commit 0940f4a into main Jan 5, 2022
@amitksingh1490 amitksingh1490 deleted the refactor/remove-type-params-http-data branch January 5, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change enhancement New feature or request maintenance Chore or Maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants