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 : use lambda instead of std::bind #11507

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented Jan 30, 2025

This commit replaces the two usages of std::bind in favor of lambdas for the callback functions for callback_new_task and callback_update_slots.

The motivation for this changes is consistency with the rest of the code in server.cpp (lambdas are used for all other callbacks/handlers). Also lambdas are more readable (perhaps this is subjective) but also they are recommended over std::bind in modern C++.

Ref: https://github.com/LithoCoders/dailycpp/blob/master/EffectiveModernC%2B%2B/chapter6/Item34_Prefer_lambdas_to_std::bind.md

This commit replaces the two usages of `std::bind` in favor of lambdas for
the callback functions for `callback_new_task` and
`callback_update_slots`.

The motivation for this changes is consistency with the rest of the code
in server.cpp (lambdas are used for all other callbacks/handlers). Also
lambdas are more readable (perhaps this is subjective) but also they are
recommended over `std::bind` in modern C++.

Ref: https://github.com/LithoCoders/dailycpp/blob/master/EffectiveModernC%2B%2B/chapter6/Item34_Prefer_lambdas_to_std::bind.md
@danbev
Copy link
Collaborator Author

danbev commented Jan 30, 2025

The server test failure seem to be an issue with downloading the model. I'm not able to do this either at the moment. The download link is back working now and I re-ran the failing tests.

@danbev danbev merged commit 4314e56 into ggerganov:master Jan 30, 2025
36 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants