raul

raul

Distributed Services with Go: Chapter 3 suggestions

Page 28: It implements io.ReaderAt on the store type.

  • Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt?

Page 29:
func (s *store) Close() error {
s.mu.Lock()
defer s.mu.Unlock()
err := s.buf.Flush()
if err != nil {
return err
}

  • Possibly:
    if err := s.buf.Flush(); err != nil {
    return err
    }

Page 31: At the end of store_test.go

  • Could you please include instructions/Makefile to execute the tests?
  • I finally managed to run them by cd’ing into internal/log and running ‘go test -v’ but this was after a bunch of failed attempts at running them.

Page 30-50: I would suggest running the tests after each of the Store, Index, and Segment would help people stay more engaged? Otherwise it seems too much (25 pages) code reading without interactivity.

Page 34: an ungraceful shutdown

  • Does ‘forceful’ shutdown sound more appealing than ‘ungraceful’?

Page 37: type Config struct {

  • I was trying to execute index_test.go and index.go and was trying to figure out what the unresolved Config was. Would it help to move this definition ahead of usage?

Page 36: Then we verify that the index and scanner error when

  • that the index and scanner ‘throw an error’ when?

Page 37: We need the next and base offsets to know…

  • This isn’t clear. Could you please consider drawing a simple picture to clarify this better?

Page 39: func (s *segment) Append(record *api.Record) (offset uint64, err error) {

  • Please consider forward declaring the definition of Record to make compilation and execution possible.

Page 41: import (
“fmt”
“os”
“path”

"github.com/gogo/protobuf/proto"
api "github.com/travisjeffery/proglog/api/v1"

)

Page 43: api “github.com/travisjeffery/proglog/api/v1

Page 43: Next, add the this setup() method below NewLog()

  • Next, add ‘this’ setup() method below NewLog()

Page 48: api “github.com/travisjeffery/proglog/api/v1

Page 51: testReader(*testing.T, *log.Log) tests that we can read the full, raw log as it’s stored on disk so that on, when we can snapshot

  • so that on ‘startup’?, when we can snapshot - something is off here

Popular Prag Prog topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New

Latest in PragProg

View all threads ❯