-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Customizable protocol #209
Conversation
def serve(host, port, request_handler, error_handler, before_start=None, | ||
after_start=None, before_stop=None, after_stop=None, | ||
debug=False, request_timeout=60, sock=None, | ||
def serve(protocol, host, port, request_handler, error_handler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be smart to put this at the front of the arguments list and possibly break functionality for anyone who uses this? I think putting this at the end and defaulting it to our own HttpProtocol would be better in this case.
@seemethere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to write a test for this? Also could you include an example of a custom HttpProtocol implementation?
@seemethere |
@seemethere |
In the current implementation, the developer can not change the behavior of the protocol.
By implementing a subclass of HttpProtocol and making it an argument of the
run
function,the developer can change the behavior when data is received and the behavior when an error occurs.
This is related #115 and #208 .