(PECL memcached >= 0.1.0)
Memcached::getByKey — Retrieve an item from a specific server
$server_key
, string $key
, callable $cache_cb
= ?
, int $flags
= ?
) : mixed
Memcached::getByKey() is functionally equivalent to
Memcached::get(), except that the free-form
server_key
can be used to map the
key
to a specific server.
server_key
A chave identificando o servidor onde armazenar ou recuperar o valor. Em vez de fazer o hash do item, é feito o hash da chave do servidor quando decidindo com qual servidor memcached conectar. Isto permite que itens relacionados sejam agrupados em um único servidor para maior eficiência de operações múltiplas.
key
The key of the item to fetch.
cache_cb
Read-through caching callback or null
flags
Flags to control the returned result. When value of Memcached::GET_EXTENDED
is given will return the CAS token.
Returns the value stored in the cache or false
otherwise.
The Memcached::getResultCode() will return
Memcached::RES_NOTFOUND
if the key does not exist.
Versão | Descrição |
---|---|
PECL memcached 3.0.0 |
The &cas_token parameter was removed.
Instead flags was added and when it is given the value of Memcached::GET_EXTENDED it will ensure the CAS token to be fetched.
|