awesome-code-reading icon indicating copy to clipboard operation
awesome-code-reading copied to clipboard

Memberlist

Open lucasleecr opened this issue 7 years ago • 0 comments

Link to the codebase

https://github.com/hashicorp/memberlist/

Which release/version did you read?

Commit https://github.com/hashicorp/memberlist/commit/bfc6c8886aaf7d2f180da4717014f54f73e307a6. The project doesn't do releases too often.

Why it is a good project to read?

  • Membership in distributed systems. Re-useable in other projects.
  • memberlist is a building block for Serf, which is a building block for Consul.

Starting point

memberlist.go (https://github.com/hashicorp/memberlist/blob/bfc6c8886aaf7d2f180da4717014f54f73e307a6/memberlist.go)

Reading order

No specific order.

Interesting parts

  • The Delegate interface that can be used as hooks in the gossip layer.
  • Payload handling, including encrypted messages

Any parts should be skipped?

No.

Any other tips?

  • Read the tests. It helps to understand how interfaces are used. It also has end-to-end tests.

Links and resources

  • Api doc https://godoc.org/github.com/hashicorp/memberlist
  • Serf homepage https://www.serf.io/

Contributor

@lucasleecr

lucasleecr avatar Oct 01 '18 22:10 lucasleecr