-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kgo.Dialer: breaking change for easier API usage
By not including the network in the function passed to Dialer, the API made it impossible to just pass a {net/tls}.Dialer.DialContext. Doing so encouraged wrapper closures that would allocate a new dialer for every dial. The original API was chosen because I did not want to assume the network (tcp or udp) that people wanted to use. This new change requires the network to be tcp, but we can easily add a new option in the future, DialerNetwork(string), that allows overriding the now-required tcp network. This new option makes it easier to use Dialer and matches other places in the Go stdlib that take dialers (specifically, http.Transport's DialContext)
- Loading branch information
Showing
3 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters