gitea

Development moved to Codeberg

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
# gomemcached

This is a memcached binary protocol toolkit in [go][go].

It provides client and server functionality as well as a little sample
server showing how I might make a server if I valued purity over
performance.

## Server Design

<div>
  <img src="http://dustin.github.com/images/gomemcached.png"
       alt="overview" style="float: right"/>
</div>

The basic design can be seen in [gocache].  A [storage
server][storage] is run as a goroutine that receives a `MCRequest` on
a channel, and then issues an `MCResponse` to a channel contained
within the request.

Each connection is a separate goroutine, of course, and is responsible
for all IO for that connection until the connection drops or the
`dataServer` decides it's stupid and sends a fatal response back over
the channel.

There is currently no work at all in making the thing perform (there
are specific areas I know need work).  This is just my attempt to
learn the language somewhat.

[go]: http://golang.org/
[gocache]: gomemcached/blob/master/gocache/gocache.go
[storage]: gomemcached/blob/master/gocache/mc_storage.go