Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amidam opened this issue Oct 17, 2021 · 6 comments
Open

Comments

@amidam
Copy link
Contributor

amidam commented Oct 17, 2021

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?

@peterbourgon
Copy link
Member

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

@amidam
Copy link
Contributor Author

amidam commented Oct 22, 2021

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)

@dibrinsofor
Copy link

can i work on this too? @peterbourgon

@peterbourgon
Copy link
Member

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

@dibrinsofor
Copy link

@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?

@peterbourgon
Copy link
Member

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

@peterbourgon peterbourgon removed their assignment Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants