"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/vendor/mcmc/README.md" (21 Feb 2022, 2652 Bytes) of package /linux/www/memcached-1.6.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Minimal (C) Client for MemCached

WARNING: WORK IN PROGRESS. Missing features or testing!

MCMC is a minimalistic allocation-free modern client for memcached. It uses a generic response parser, allowing a single code path regardless of the command sent to memcached. It has no 3rd party dependencies and is designed to integrate as a building block into full clients.

MCMC does not (yet) include a typical memcached “selector”. Meaning the ability to add many servers to a hash table of some kind and routing keys to specific servers. The MCMC base client is designed to be an object that selector objects hold and then issue commands against.

Allocation-free (aside from a call to getaddrinfo()) means it does not internally do any allocations, relying only on the stack. It requires you malloc a small structure and some buffers, but you are then free to manage them yourselves. Clients do not hold onto buffers when idle, cutting their memory overhead to a handful of bytes plus the TCP socket.

MCMC is designed to be a building block for users designing full clients. For example:

This should be the same, if not less, code than wrapping a full C client with every possible command broken out. It also means 3rd party clients can (and should!) embed mcmc.c/mcmc.h (and any selector code they want) rather than be dependent on system distribution of a more complex client.

The allocation-free nature also makes unit testing the client code easier, hopefully leading to higher quality.

Caveats:

As of this writing the code is being released early (perhaps too early?). It may not have proper makefiles, tests, or a fully implemented API. The code has been posted so client authors and users can give early feedback on the API in hopes of prodiving something high quality and stable.

Again, looking for feedback! Open an issue or let me know what you think.