danieljoos / libkafka-asio

C++ Kafka Client Library using Boost Asio
MIT License
76 stars 40 forks source link

Extract ip/name resolver to a service #11

Closed DEvil0000 closed 9 years ago

DEvil0000 commented 9 years ago

I think it would make sense to extract the resolver code to have some kind of resolver/lookup service. At the moment it is used to establish the connection but it could also be useful to map a host:port string to a Connection or Broker UID. And in this case we need to resolve the thing in the Client and not the Connection.

Do you see a problem with this?

danieljoos commented 9 years ago

I wouldn't do that. The boost asio library already encapsulates the name resolving as a service and the library code just uses it. Why should we wrap another service around it. In my opinion, a Client implementation should not do name resolving. It should just use the Connection objects for that (also for fetching the meta data).