kit icon indicating copy to clipboard operation
kit copied to clipboard

Mismatch of the tutorial section of stringsvc example and its full code

Open amidam opened this issue 4 years ago • 6 comments

What would you like?

I have noticed a couple of differences between the tutorial section of the stringsvc3 example and its full source code. It is worth mentioning the differences are about different imports, or different number of parameters of a particular function. I was wondering which one is the most up to date one?

amidam avatar Oct 17 '21 10:10 amidam

Can you enumerate some of them? I am happy to fix them.

peterbourgon avatar Oct 18 '21 16:10 peterbourgon

Can you enumerate some of them? I am happy to fix them.

Thanks Peter!

  • First of all, in the tutorial section of stringsvc3, there is no context while in the github code(ex:proxying.go) there is. It seems that the advance topic of the tutorial section is also included in stringsvc3.
  • Line 51 of the proxying.go is e = ratelimit.NewErroringLimiter(rate.NewLimiter(rate.Every(time.Second), qps))(e), but in the tutorial is e = kitratelimit.NewTokenBucketLimiter(jujuratelimit.NewBucketWithRate(float64(maxQPS), int64(maxQPS)))(e). Actually, jujuratelimit is not imported at all in the full code.
  • Line 44 of the the same file is endpointer sd.FixedEndpointer, but in the tutorial is subscriber sd.FixedSubscriber. Thus in line 52, you can see endpointer = append(endpointer, e), while in the tutorial is subscriber = append(subscriber, e) and of course the same mismatch in line 57 where there is balancer := lb.NewRoundRobin(endpointer) but in the toturial is balancer := lb.NewRoundRobin(subscriber)

amidam avatar Oct 22 '21 20:10 amidam

can i work on this too? @peterbourgon

dibrinsofor avatar Mar 13 '22 19:03 dibrinsofor

Yeah, go for it. Haven't gotten to it.

peterbourgon avatar Mar 13 '22 19:03 peterbourgon

@peterbourgon great. where can I find the html files for https://gokit.io/examples/stringsvc.html#calling-other-services, and how do I know which file is more recent? should I just play around with them?

dibrinsofor avatar Mar 15 '22 17:03 dibrinsofor

https://github.com/go-kit/go-kit.github.io

peterbourgon avatar Mar 15 '22 18:03 peterbourgon