[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-19 Thread Ankit Gupta
Hi Matt, Ok, if you meant the type embedding -- I usually prefer it for composition purpose, so that I can pass around the composed type (or pointer) to function calls. Did not find any such need. I haven’t gotten far enough into network services to have much to say about > the features althou

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread matthewjuran
By embedding I meant this: type ServiceQProperties struct { ... sync.Mutex } which allows you to call p.Lock() instead of p.REMutex.Lock(). It’s just a personal preference that I was happy about when I learned about it. One thought here is you could make it a *sync.Mutex and not use a p

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread Ankit Gupta
Hi Matt, First of all, thanks so much for the review. I will revisit the package structure and take care of err handling in a more idiomatic way. Few points - - The mutex is embedded in model.ServiceQProperties. Here is the definition in model.balancer_properties.go - type ServiceQPropertie

[go-nuts] Re: Load balancing with error feedback capabilities

2018-05-18 Thread matthewjuran
Hi Ankit, thanks for the Apache license and for sharing here. Here’s a code review. These are my unfiltered opinions and I hope that they are useful. Without looking at any code yet, the packages might not be idiomatic. Packages should contain specific behavior that can be decoupled from the a