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

transport: get rid of the TransportFactoryId abstraction and the associated registry #278

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Sep 9, 2024

TransportFactoryId was used to encapsulate a "name" and a unique identifier for each transport type, from which we had two:

  1. socket
  2. tls

Since the switching between transports will only happen a couple of times within the lifetime of a connection, we don't need to optimize the lookup of the required transport to switch to.

This patch simply changes the TransportFactoryId with a string and the lookup by ID to a lookup by string. The string identifiers are encapsulated in macros, so misspelling on the call sites is not likely. And we only have one single call site.

By removing the TransportFactoryId and TransportFactoryRegistry I can easily get rid off 400 lines of complex, difficult to read code.

@bazsi bazsi force-pushed the transport-remove-transport-registry branch from a649cbe to 08baf0b Compare September 9, 2024 18:00
…ciated registry

TransportFactoryId was used to encapsulate a "name" and a unique identifier
for each transport type, from which we had two:
1) socket
2) tls

Since the switching between transports will only happen a couple of times
within the lifetime of a connection, we don't need to optimize the
lookup of the required transport to switch to.

This patch simply changes the TransportFactoryId with a string and the
lookup by ID to a lookup by string. The string identifiers are encapsulated
in macros, so misspelling on the call sites is not likely. And we only
have one single call site.

By removing the TransportFactoryId and TransportFactoryRegistry I can
easily get rid off 400 lines of complex, difficult to read code.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the transport-remove-transport-registry branch from 08baf0b to 8efebf9 Compare September 15, 2024 17:37
@bazsi
Copy link
Member Author

bazsi commented Sep 15, 2024

I've updated #156 to be based on top of this and finished off the conversion from LogProto to LogTransport when supporting the HAProxy protocol.

@MrAnno MrAnno merged commit fef0ee7 into axoflow:main Sep 19, 2024
22 checks passed
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