# ``twisted`.`protocols`.`memcache``

module documentation
(source)

Memcache client protocol. Memcached is a caching server, storing data in the form of pairs key/value, and memcache is the protocol to talk with it.

To connect to a server, create a factory for `MemCacheProtocol`:

        from twisted.internet import reactor, protocol
        from twisted.protocols.memcache import MemCacheProtocol, DEFAULT_PORT
        d = protocol.ClientCreator(reactor, MemCacheProtocol
            ).connectTCP("localhost", DEFAULT_PORT)
        def doSomething(proto):
            # Here you call the memcache operations
            return proto.set("mykey", "a lot of data")
        d.addCallback(doSomething)
        reactor.run()

All the operations of the memcache protocol are present, but `MemCacheProtocol.set` and `MemCacheProtocol.get` are the more important.

See http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt for more information about the protocol.

Class | `ClientError` | Error caused by an invalid client call.
Class | `Command` | Wrap a client action into an object, that holds the values used in the protocol.
Class | `MemCacheProtocol` | MemCache protocol: connect to a memcached server to store/retrieve values.
Class | `NoSuchCommand` | Exception raised when a non existent command is called.
Class | `ServerError` | Problem happening on the server.
Constant | `DEFAULT_PORT` | Undocumented

DEFAULT_PORT: `int` = (source)

Undocumented

Value

    11211