Skip to content

Use futures efficiently #177

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Use futures efficiently #177

wants to merge 19 commits into from

Conversation

FractalBoy
Copy link
Owner

Rather than peppering code with calls to Future->retain(), this returns a future back to the server for it to await.

In some cases, returning a future would be too difficult, so we call ->get or ->await to get the result.

Additionally, now that we can return a future to the server, it should be able to process requests that have already been read into the read buffer faster (and present in $buffref), since calling ->get or ->await will only return control to the main server read function when there is more data to be read (not when the data has already been read but not parsed).

@FractalBoy FractalBoy force-pushed the use-futures-efficiently branch from a7d4931 to 6730db9 Compare February 26, 2025 04:34
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