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

convert ServerResponseHandler to class. #1086

Closed
wants to merge 1 commit into from
Closed

Conversation

amitksingh1490
Copy link
Collaborator

@amitksingh1490 amitksingh1490 commented Feb 23, 2022

fixes #1085

@github-actions github-actions bot added the bug Something isn't working label Feb 23, 2022
@amitksingh1490 amitksingh1490 added maintenance Chore or Maintenance tasks refactor and removed bug Something isn't working labels Feb 23, 2022
@amitksingh1490 amitksingh1490 linked an issue Feb 23, 2022 that may be closed by this pull request
@github-actions github-actions bot added the bug Something isn't working label Feb 23, 2022
@amitksingh1490 amitksingh1490 removed the bug Something isn't working label Feb 23, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1086 (f9f9e4d) into main (f632f58) will increase coverage by 0.02%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
+ Coverage   57.61%   57.64%   +0.02%     
==========================================
  Files          73       73              
  Lines        2291     2290       -1     
  Branches       69       67       -2     
==========================================
  Hits         1320     1320              
+ Misses        971      970       -1     
Impacted Files Coverage Δ
...io-http/src/main/scala/zhttp/service/Handler.scala 72.72% <75.00%> (+3.49%) ⬆️
zio-http/src/main/scala/zhttp/http/Http.scala 75.16% <100.00%> (ø)
zio-http/src/main/scala/zhttp/service/Server.scala 44.11% <100.00%> (+0.83%) ⬆️
...erver/content/handlers/ServerResponseHandler.scala 95.45% <100.00%> (ø)

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 f632f58...f9f9e4d. Read the comment docs.

@@ -13,9 +13,7 @@ import zio.{UIO, ZIO}
import java.io.RandomAccessFile

@Sharable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@Sharable

private[zhttp] trait ServerResponseHandler[R] {
def serverTime: ServerTime
val rt: HttpRuntime[R]
private[zhttp] final class ServerResponseHandler[R](runtime: HttpRuntime[R], serverTime: ServerTime) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
private[zhttp] final class ServerResponseHandler[R](runtime: HttpRuntime[R], serverTime: ServerTime) {
private[zhttp] final class HttpResponseService[R](runtime: HttpRuntime[R], serverTime: ServerTime) {

with ServerResponseHandler[R] { self =>

with WebSocketUpgrade[R] { self =>
type Ctx = ChannelHandlerContext
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type Ctx = ChannelHandlerContext
type Ctx = ChannelHandlerContext
val responseService = new ServerResponseHandler[R](zExec, ServerTime.make)

@tusharmath tusharmath closed this Feb 24, 2022
@tusharmath
Copy link
Collaborator

Need to think about the design a little bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Chore or Maintenance tasks ready refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass instance of trait ServerResponseHandler[R] to Handler
3 participants