Behaviour implemented by every wire-protocol handler (Riak, Redis, etcd, memcached).
A handler is a pure request parser driven by FakeRiak.Connection:
init/0returns the initial per-connection parser state.parse/2is handed the bytes received so far plus the current state and returns one of:{:reply, response, rest, state}— a complete request was parsed;response(iodata) is sent back and parsing continues onrest.{:need_more, state}— the buffer does not yet contain a full request; the loop reads more bytes and callsparse/2again.{:close, response}— send the (possibly empty)responseand close the connection.