fishy commented on code in PR #3379:
URL: https://github.com/apache/thrift/pull/3379#discussion_r3055026531


##########
lib/go/thrift/server_socket.go:
##########
@@ -25,16 +26,20 @@ import (
        "time"
 )
 
+// TServerSocketListenerFactory abstracts how listeners are created.
+type TServerSocketListenerFactory func(listen bool) (net.Addr, net.Listener, 
error)

Review Comment:
   I kind of get your idea but I still find this confusing as a public API. I 
think you are just trying to squash 2 functions into 1? e.g. either:
   1. start listing, return _configured_ listener address, listener, and error
   or
   2. just return the _configured_ listener address
   
   note that `Listener` interface also has api to return the address, but that 
can be different from the configured address (`:0` vs. the actually randomly 
picked port, for example).
   
   I also don't like boolean args, as they almost always force you to dig into 
function signature to understand what `true` and `false` means when you read 
the code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to