Gauche-memcache Reference Manual

For version 0.1.0

last update: Fri Aug 10 2007

http://fixedpoint.jp/gauche-memcache/

Warning: still unstable.

Information

At first see the protocol docs: http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt

API

class: <memcache-connection>

The class abstracts connections to memcached.

You will get its instance by calling procedure "memcache-connect".


class: <memcache-error>

class: <memcache-client-error>

class: <memcache-server-error>

These errors represent ERROR, CLIENT_ERROR and SERVER_ERROR from memcached respectively.

An instance of either <memcache-client-error> or <memcache-server-error> has slot 'message'.


procedure: memcache-connect host port

Return a connection to memcached. An error occurs if failed.


method: memcache-close (conn <memcache-connection>)

Close the connection. See also method "quit".


parameter: *memcache-read-line-max*

parameter: *memcache-read-retry-max*

parameter: *memcache-read-nanosecond*

The parameter *memcache-read-line-max* keeps the max of length of the response line, which default value is 256

For *memcache-read-retry-max* and *memcache-read-nanosecond*, read the source.


method: set (conn <memcache-connection>) key value &optional opt

method: add (conn <memcache-connection>) key value &optional opt

method: replace (conn <memcache-connection>) key value &optional opt

Set the value with key by command 'set'/'add'/'replace', resp.

Return #t in case of success, or #f otherwise.


method: get (conn <memcache-connection>) &optional keys

Return entries with keys as alist.


method: delete (conn <memcache-connection>) key &optional opt

Delete the entry with key.

Return #t if done, or #f otherwise.


method: incr (conn <memcache-connection>) key value

method: decr (conn <memcache-connection>) key value

Increment/decrement the entry with key by value.

Return the resulting value if done, or #f if there is no such entry.


method: stats (conn <memcache-connection>) &optional opt

Return the stats of memcached as string.


method: flush-all (conn <memcache-connection>) &optional opt

Drop all of the entries with possible delay.

Return #t in case of success.


method: version (conn <memcache-connection>)

Return the version of memcached as string.


method: quit (conn <memcache-connection>)

Publish command 'quit'. See also method "memcache-close".


CGI Session with memcache

For documentation on CGI session with memcache, see: http://fixedpoint.jp/gauche-cgi-ext/
© 2007 Takeshi Abe