Skip to content

Conversation

@PlugaruT
Copy link

Changes

  • implement HTTP bindings for V2

One line description for the changelog

  • Tests pass
  • Appropriate changes to README are included in PR

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]>
@PlugaruT
Copy link
Author

@xSAVIKx Can you please have a look when you are available 🙏

Copy link
Member

@xSAVIKx xSAVIKx left a 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:

Image

And there are a couple of things I think we should do a bit differently but otherwise a good job 🙏

Comment on lines 169 to 176
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)
Copy link
Member

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.

Copy link
Author

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.

Copy link
Author

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

@PlugaruT PlugaruT requested a review from xSAVIKx November 20, 2025 14:33
@PlugaruT
Copy link
Author

@xSAVIKx this is ready again. I think I addressed your comments. Can you please review 🙏

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.

2 participants