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

server.rs - move response handling into .process() #1727

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

rukai
Copy link
Member

@rukai rukai commented Aug 19, 2024

This PR:

There are a few renames:

  • process_messages -> run_loop
    • process_messages is confusing since we already have a .process method and its not clear what the difference is.
      • the difference is that it runs the chain in an infinite loop. So better to name it after the run method that calls it and add _loop
    • send_receive_chain_loop could also be a reasonable name
  • process -> send_receive_chain
    • it takes requests as args and sends them down the chain, sending the response to the client, so this rename makes it clear what exactly is being processed.

The main point of the PR is to move sending of responses into send_receive_chain.
To achieve this the CloseReason enum is introduced, currently only the existence of the CloseReason is meaningful so there is only one variant.
The existence of the CloseReason indicates to run_loop whether to terminate the loop or not.
CloseReason will be extended in #1722 to have unique handling for different close reasons.

Copy link

codspeed-hq bot commented Aug 19, 2024

CodSpeed Performance Report

Merging #1727 will not alter performance

Comparing rukai:refactor_server (d4a2d67) with main (76c7845)

Summary

✅ 39 untouched benchmarks

@rukai rukai merged commit 17ccad5 into shotover:main Aug 19, 2024
41 checks passed
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.

3 participants