Oracle 5.0 Reference Manual page 1386

Table of Contents

Advertisement

value_length[x] = strlen(values[x]);
rc= memcached_set(memc, keys[x], key_length[x], values[x],
if (rc == MEMCACHED_SUCCESS)
fprintf(stderr,"Key %s stored successfully\n",keys[x]);
else
fprintf(stderr,"Couldn't store key: %s\n",memcached_strerror(memc, rc));
}
rc= memcached_mget(memc, keys, key_length, 3);
if (rc == MEMCACHED_SUCCESS)
{
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
{
if (rc == MEMCACHED_SUCCESS)
}
}
return 0;
}
Running the above application produces the following output:
shell> memc_multi_fetch
Added server successfully
Key huey stored successfully
Key dewey stored successfully
Key louie stored successfully
Key huey returned red
Key dewey returned blue
Key louie returned green
15.6.3.3.5. Controlling
The behavior of
either be set globally, or they can be applied during the call to individual functions. Some behaviors
also accept an additional setting, such as the hashing mechanism used when selecting servers.
To set global behaviors:
memcached_return
memcached_behavior_set (memcached_st *ptr,
To get the current behavior setting:
uint64_t
memcached_behavior_get (memcached_st *ptr,
The following table describes
Behavior
MEMCACHED_BEHAVIOR_NO_BLOCK
MEMCACHED_BEHAVIOR_TCP_NODELAY
MEMCACHED_BEHAVIOR_HASH
Developing a
value_length[x], (time_t)0, (uint32_t)0);
{
fprintf(stderr,"Key %s returned %s\n",return_key, return_value);
}
Behaviors
libmemcached
can be modified by setting one or more behavior flags. These can
libmemcached
memcached_behavior flag,
uint64_t data);
memcached_behavior flag);
libmemcached
Application
memcached
&return_value_length, &flags, &rc)) != NULL)
behavior flags.
Description
Caused
libmemcached
Turns on no-delay for network sockets.
Without a value, sets the default hashing algorithm
for keys to use MD5. Other valid values include
MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5,
MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64,
MEMCACHED_HASH_FNV1A_64,
1366
to use asynchronous I/O.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents