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

Remove HTTP2Settings from ServerParams #260

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Remove HTTP2Settings from ServerParams #260

merged 1 commit into from
Nov 20, 2024

Conversation

edsko
Copy link
Collaborator

@edsko edsko commented Nov 20, 2024

This was a relatively common pattern:

server <- mkGrpcServer serverParams $ ..
forkServer serverParams serverConfig server $ \runningServer -> ..

but it is misleading: notice that the serverParams need to be passed twice, even though on call to forkServer we need only the HTTP2Settings, and on the call to mkGrpcServer we need everything in ServerParams except the HTTP2Settings: they are completely separate. This gets even more confusing in a pattern such as this:

server <- mkGrpcServer def $ ..
forkServer def serverConfig server $ \runningServer -> ..

where we are using def in both places; becomes quite easy to make a change in the wrong place, and then be confused that it didn't take effect. We are now separating these two values out completely.

@edsko edsko force-pushed the edsko/http2settings branch from 33eb58f to 8e7a483 Compare November 20, 2024 10:05
This was a relatively common pattern:

```haskell
server <- mkGrpcServer serverParams $ ..
forkServer serverParams serverConfig server $ \runningServer -> ..
```

but it is misleading: notice that the `serverParams` need to be passed _twice_,
even though on call to `forkServer` we need _only_ the `HTTP2Settings`, and on
the call to `mkGrpcServer` we need everything in `ServerParams` _except_ the
`HTTP2Settings`: they are completely separate. This gets even more confusing in
a pattern such as this:

```haskell
server <- mkGrpcServer def $ ..
forkServer def serverConfig server $ \runningServer -> ..
```

where we are using `def` in both places; becomes quite easy to make a change in
the wrong place, and then be confused that it didn't take effect. We are now
separating these two values out completely.
@edsko edsko force-pushed the edsko/http2settings branch from 8e7a483 to 036133f Compare November 20, 2024 10:07
@edsko edsko merged commit 08b5990 into main Nov 20, 2024
6 checks passed
@edsko edsko deleted the edsko/http2settings branch November 20, 2024 10:21
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.

1 participant