Class t.p.m.MemCacheProtocol(LineReceiver, TimeoutMixin):

Part of twisted.protocols.memcache View Source View In Hierarchy

MemCache protocol: connect to a memcached server to store/retrieve values.
Instance VariablespersistentTimeOutthe timeout period used to wait for a response. (type: int )
_currentcurrent list of requests waiting for an answer from the server. (type: deque of Command )
_lenExpectedamount of data expected in raw mode, when reading for a value. (type: int )
_getBuffercurrent buffer of data, used to store temporary data when reading in raw mode. (type: list )
_bufferLengththe total amount of bytes in _getBuffer. (type: int )

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
136 Method __init__ Create the protocol.
151 Method timeoutConnection Close the connection in case of timeout.
160 Method sendLine Override sendLine to add a timeout to response.
169 Method rawDataReceived Collect data for a get.
189 Method cmd_STORED Manage a success response to a set operation.
196 Method cmd_NOT_STORED Manage a specific 'not stored' response to a set operation: this is not
204 Method cmd_END This the end token to a get or a stat operation.
217 Method cmd_NOT_FOUND Manage error response for incr/decr/delete.
224 Method cmd_VALUE Prepare the reading a value after a get.
245 Method cmd_STAT Reception of one stat line.
254 Method cmd_VERSION Read version token.
261 Method cmd_ERROR An non-existent command has been sent.
270 Method cmd_CLIENT_ERROR An invalid input as been sent.
279 Method cmd_SERVER_ERROR An error has happened server-side.
288 Method cmd_DELETED A delete command has completed successfully.
295 Method cmd_OK The last command has been completed.
302 Method cmd_EXISTS A checkAndSet update has failed.
309 Method lineReceived Receive line commands from the server.
339 Method increment Increment the value of key by given value (default to 1).
357 Method decrement Decrement the value of key by given value (default to 1).
392 Method replace Replace the given key. It must already exist in the server.
416 Method add Add the given key. It must not exist in the server.
440 Method set Set the given key.
464 Method checkAndSet Change the content of key only if the cas value matches the
518 Method append Append given data to the value of an existing key.
537 Method prepend Prepend given data to the value of an existing key.
556 Method get Get the given key. It doesn't support multiple keys. If
592 Method stats Get some stats from the server. It will be available as a dict.
606 Method version Get the version of the server.
620 Method delete Delete an existing key.
640 Method flushAll Flush all cached values.
376 Method _incrdecr Internal wrapper for incr/decr.
493 Method _set Internal wrapper for setting values.

Inherited from LineReceiver:

Line # Kind Name Docs
207 Method clearLineBuffer Clear buffered data.
211 Method dataReceived Protocol.dataReceived.
241 Method setLineMode Sets the line-mode of this receiver.
256 Method setRawMode Sets the raw mode of this receiver.
278 Method lineLengthExceeded Called when the maximum line length has been reached.

Inherited from Protocol (via LineReceiver):

Line # Kind Name Docs
384 Method connectionLost Called when the connection is shut down.

Inherited from BaseProtocol (via LineReceiver, Protocol):

Line # Kind Name Docs
341 Method makeConnection Make a connection to a transport and a server.
351 Method connectionMade Called when a connection is made.

Inherited from _PauseableMixin (via LineReceiver):

Line # Kind Name Docs
172 Method pauseProducing Undocumented
176 Method resumeProducing Undocumented
181 Method stopProducing Undocumented

Inherited from TimeoutMixin:

Line # Kind Name Docs
593 Method callLater Undocumented
597 Method resetTimeout Reset the timeout count down
602 Method setTimeout Change the timeout period
623 Method __timedOut Undocumented
Line # Kind Name Docs
136 Method __init__ Create the protocol.
416 Method add Add the given key. It must not exist in the server.
518 Method append Append given data to the value of an existing key.
593 Method callLater Undocumented
464 Method checkAndSet Change the content of key only if the cas value matches the
207 Method clearLineBuffer Clear buffered data.
270 Method cmd_CLIENT_ERROR An invalid input as been sent.
288 Method cmd_DELETED A delete command has completed successfully.
204 Method cmd_END This the end token to a get or a stat operation.
261 Method cmd_ERROR An non-existent command has been sent.
302 Method cmd_EXISTS A checkAndSet update has failed.
217 Method cmd_NOT_FOUND Manage error response for incr/decr/delete.
196 Method cmd_NOT_STORED Manage a specific 'not stored' response to a set operation: this is not
295 Method cmd_OK The last command has been completed.
279 Method cmd_SERVER_ERROR An error has happened server-side.
245 Method cmd_STAT Reception of one stat line.
189 Method cmd_STORED Manage a success response to a set operation.
224 Method cmd_VALUE Prepare the reading a value after a get.
254 Method cmd_VERSION Read version token.
384 Method connectionLost Called when the connection is shut down.
351 Method connectionMade Called when a connection is made.
211 Method dataReceived Protocol.dataReceived.
357 Method decrement Decrement the value of key by given value (default to 1).
620 Method delete Delete an existing key.
640 Method flushAll Flush all cached values.
556 Method get Get the given key. It doesn't support multiple keys. If
339 Method increment Increment the value of key by given value (default to 1).
278 Method lineLengthExceeded Called when the maximum line length has been reached.
309 Method lineReceived Receive line commands from the server.
341 Method makeConnection Make a connection to a transport and a server.
172 Method pauseProducing Undocumented
537 Method prepend Prepend given data to the value of an existing key.
169 Method rawDataReceived Collect data for a get.
392 Method replace Replace the given key. It must already exist in the server.
597 Method resetTimeout Reset the timeout count down
176 Method resumeProducing Undocumented
160 Method sendLine Override sendLine to add a timeout to response.
440 Method set Set the given key.
241 Method setLineMode Sets the line-mode of this receiver.
256 Method setRawMode Sets the raw mode of this receiver.
602 Method setTimeout Change the timeout period
592 Method stats Get some stats from the server. It will be available as a dict.
181 Method stopProducing Undocumented
151 Method timeoutConnection Close the connection in case of timeout.
606 Method version Get the version of the server.
623 Method __timedOut Undocumented
376 Method _incrdecr Internal wrapper for incr/decr.
493 Method _set Internal wrapper for setting values.
def __init__(self, timeOut=60): (source)
Create the protocol.
ParameterstimeOutthe timeout to wait before detecting that the connection is dead and close it. It's expressed in seconds. (type: int )
def timeoutConnection(self): (source)
Close the connection in case of timeout.
def sendLine(self, line): (source)
Override sendLine to add a timeout to response.
def rawDataReceived(self, data): (source)
Collect data for a get.
def cmd_STORED(self): (source)
Manage a success response to a set operation.
def cmd_NOT_STORED(self): (source)
Manage a specific 'not stored' response to a set operation: this is not an error, but some condition wasn't met.
def cmd_END(self): (source)
This the end token to a get or a stat operation.
def cmd_NOT_FOUND(self): (source)
Manage error response for incr/decr/delete.
def cmd_VALUE(self, line): (source)
Prepare the reading a value after a get.
def cmd_STAT(self, line): (source)
Reception of one stat line.
def cmd_VERSION(self, versionData): (source)
Read version token.
def cmd_ERROR(self): (source)
An non-existent command has been sent.
def cmd_CLIENT_ERROR(self, errText): (source)
An invalid input as been sent.
def cmd_SERVER_ERROR(self, errText): (source)
An error has happened server-side.
def cmd_DELETED(self): (source)
A delete command has completed successfully.
def cmd_OK(self): (source)
The last command has been completed.
def cmd_EXISTS(self): (source)
A checkAndSet update has failed.
def lineReceived(self, line): (source)
Receive line commands from the server.
def increment(self, key, val=1): (source)
Increment the value of key by given value (default to 1). key must be consistent with an int. Return the new value.
Parameterskeythe key to modify. (type: str )
valthe value to increment. (type: int )
Returnsa deferred with will be called back with the new value associated with the key (after the increment). (type: Deferred )
def decrement(self, key, val=1): (source)
Decrement the value of key by given value (default to 1). key must be consistent with an int. Return the new value, coerced to 0 if negative.
Parameterskeythe key to modify. (type: str )
valthe value to decrement. (type: int )
Returnsa deferred with will be called back with the new value associated with the key (after the decrement). (type: Deferred )
def _incrdecr(self, cmd, key, val): (source)
Internal wrapper for incr/decr.
def replace(self, key, val, flags=0, expireTime=0): (source)
Replace the given key. It must already exist in the server.
Parameterskeythe key to replace. (type: str )
valthe new value associated with the key. (type: str )
flagsthe flags to store with the key. (type: int )
expireTimeif different from 0, the relative time in seconds when the key will be deleted from the store. (type: int )
Returnsa deferred that will fire with True if the operation has succeeded, and False with the key didn't previously exist. (type: Deferred )
def add(self, key, val, flags=0, expireTime=0): (source)
Add the given key. It must not exist in the server.
Parameterskeythe key to add. (type: str )
valthe value associated with the key. (type: str )
flagsthe flags to store with the key. (type: int )
expireTimeif different from 0, the relative time in seconds when the key will be deleted from the store. (type: int )
Returnsa deferred that will fire with True if the operation has succeeded, and False with the key already exists. (type: Deferred )
def set(self, key, val, flags=0, expireTime=0): (source)
Set the given key.
Parameterskeythe key to set. (type: str )
valthe value associated with the key. (type: str )
flagsthe flags to store with the key. (type: int )
expireTimeif different from 0, the relative time in seconds when the key will be deleted from the store. (type: int )
Returnsa deferred that will fire with True if the operation has succeeded. (type: Deferred )
def checkAndSet(self, key, val, cas, flags=0, expireTime=0): (source)
Change the content of key only if the cas value matches the current one associated with the key. Use this to store a value which hasn't been modified since last time you fetched it.
ParameterskeyThe key to set. (type: str )
valThe value associated with the key. (type: str )
casUnique 64-bit value returned by previous call of get. (type: str )
flagsThe flags to store with the key. (type: int )
expireTimeIf different from 0, the relative time in seconds when the key will be deleted from the store. (type: int )
ReturnsA deferred that will fire with True if the operation has succeeded, False otherwise. (type: Deferred )
def _set(self, cmd, key, val, flags, expireTime, cas): (source)
Internal wrapper for setting values.
def append(self, key, val): (source)
Append given data to the value of an existing key.
ParameterskeyThe key to modify. (type: str )
valThe value to append to the current value associated with the key. (type: str )
ReturnsA deferred that will fire with True if the operation has succeeded, False otherwise. (type: Deferred )
def prepend(self, key, val): (source)
Prepend given data to the value of an existing key.
ParameterskeyThe key to modify. (type: str )
valThe value to prepend to the current value associated with the key. (type: str )
ReturnsA deferred that will fire with True if the operation has succeeded, False otherwise. (type: Deferred )
def get(self, key, withIdentifier=False): (source)
Get the given key. It doesn't support multiple keys. If withIdentifier is set to True, the command issued is a gets, that will return the current identifier associated with the value. This identifier has to be used when issuing checkAndSet update later, using the corresponding method.
ParameterskeyThe key to retrieve. (type: str )
withIdentifierIf set to True, retrieve the current identifier along with the value and the flags. (type: bool )
ReturnsA deferred that will fire with the tuple (flags, value) if withIdentifier is False, or (flags, cas identifier, value) if True. (type: Deferred )
def stats(self): (source)
Get some stats from the server. It will be available as a dict.
Returnsa deferred that will fire with a dict of the available statistics. (type: Deferred )
def version(self): (source)
Get the version of the server.
Returnsa deferred that will fire with the string value of the version. (type: Deferred )
def delete(self, key): (source)
Delete an existing key.
Parameterskeythe key to delete. (type: str )
Returnsa deferred that will be called back with True if the key was successfully deleted, or False if not. (type: Deferred )
def flushAll(self): (source)
Flush all cached values.
Returnsa deferred that will be called back with True when the operation has succeeded. (type: Deferred )
API Documentation for Twisted, generated by pydoctor at 2008-10-26 16:12:37.