-
Notifications
You must be signed in to change notification settings - Fork 60
feat: implement http bindings #251
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
base: v2
Are you sure you want to change the base?
Conversation
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
|
@xSAVIKx Can you please have a look when you are available 🙏 |
xSAVIKx
left a comment
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.
@PlugaruT thanks for the PR!
mypy has smth to say:
And there are a couple of things I think we should do a bit differently but otherwise a good job 🙏
| normalized_headers = _normalize_headers(message.headers) | ||
|
|
||
| attributes: Dict[str, Any] = {} | ||
|
|
||
| for header_name, header_value in normalized_headers.items(): | ||
| if header_name.startswith(CE_PREFIX): | ||
| attr_name = header_name[len(CE_PREFIX) :] | ||
| attributes[attr_name] = _decode_header_value(attr_name, header_value) |
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.
While this is factually a correct way we should take into account that CE are kinda low-level transport protocol messages. Creating a lot of intermediate objects here like doing this headers normalization may look like a small thing but will lead to bloating up resources consumption and while this is some new code, it may be a good opportunity to also think about doing this in an optimal way when possible.
it may be better to have a single for loop and do all the checks we want (CE-prefixed headers, content type header, etc) in a single run to avoid extra data structured and extra lookups.
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.
That's fair. Let me see what can I do.
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.
Done. Let me know if it's better
Signed-off-by: Tudor Plugaru <[email protected]>
…udor/add-http-bindings
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
Signed-off-by: Tudor Plugaru <[email protected]>
|
@xSAVIKx this is ready again. I think I addressed your comments. Can you please review 🙏 |
Changes
One line description for the changelog