Skip to content

Instantly share code, notes, and snippets.

@posulliv
Created September 19, 2009 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save posulliv/189562 to your computer and use it in GitHub Desktop.
Save posulliv/189562 to your computer and use it in GitHub Desktop.
/* various ways to construct a memcached client */
memcache::Memcache first_client("server:11211");
memcache::Memcache second_client("server1:11211 server2:11211");
memcache::Memcache third_client("server", port_num);
/* basic operations */
first_client.set("key", some_vector_of_chars, time_to_live, flags);
first_client.get("key", some_vector_to_fill_with_data);
first_client.remove("key");
/* add a memcached server */
third_client.addServer("server", port_num);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment