Skip to content

Make cycle_callback a functor (+ rename cycle_callback -> data_callback) #73

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

Closed
wants to merge 7 commits into from

Conversation

vozhyk-
Copy link
Contributor

@vozhyk- vozhyk- commented Apr 10, 2015

There can be a need to preserve some state across calls to the callback. With this change, it becomes possible to do this using a subclass of data_callback [1].
I'm not sure if it's the best way to do it. The same can be done with a C++11 capturing lambda (and supported with templates on libhttpserver side).
Also, making it an alternative to a simple function pointer instead of replacing it looks like a better idea, but I don't know which way to do it is the best.

/**
* @param buf Buffer to copy data to
* @param max Maximum number of bytes allowed to be copied
* @return number of bytes copied, or
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be improved by mirroring MHD documentation

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 68.89% when pulling 149f936 on vozhyk-:master into 2d0093e on etr:master.

@etr
Copy link
Owner

etr commented Apr 24, 2015

This is definitely interesting.
Give me some time to try possible different approaches and I'll come back to you.

@etr
Copy link
Owner

etr commented Feb 11, 2019

Added to the repo: #145

@etr etr closed this Feb 11, 2019
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