Current Path : /usr/lib/python2.7/dist-packages/twisted/protocols/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/protocols/memcache.pyc |
ó [³XMc @ s d Z y d d l m Z Wn' e k rC d e f d „ ƒ YZ n Xd d l m Z d d l m Z d d l m Z m Z m Z d d l m Z d Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e e f d „ ƒ YZ d d d d d g Z d S( sp 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 L{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 L{MemCacheProtocol.set} and L{MemCacheProtocol.get} are the more important. See U{http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt} for more information about the protocol. iÿÿÿÿ( t dequeR c B s e Z d „ Z RS( c C s | j d ƒ S( Ni ( t pop( t self( ( s>