Full CAS support now enabled in the library.
[awesomized/libmemcached] / docs / memcached_behavior.pod
1 =head1 NAME
2
3 memcached_behavior_get memcached_behavior_set
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
11 #include <memcached.h>
12
13 unsigned long long
14 memcached_behavior_get (memcached_st *ptr,
15 memcached_behavior flag);
16
17 memcached_return
18 memcached_behavior_set (memcached_st *ptr,
19 memcached_behavior flag,
20 void *data);
21
22 =head1 DESCRIPTION
23
24 libmemcached(3) behavior can be modified by use memcached_behavior_set().
25 Default behavior is the library strives to be quick and accurate. Some
26 behavior, while being faster, can also result in not entirely accurate
27 behavior (for instance, memcached_set() will always respond with
28 C<MEMCACHED_SUCCESS>).
29
30 memcached_behavior_get() takes a behavior flag and returns whether or not
31 that behavior is currently enabled in the client.
32
33 memcached_behavior_set() changes the value of a particular option of the
34 client. It takes both a flag (listed below) and a value. For simple on or
35 off options you just need to pass in a value of 1. Calls to
36 memcached_behavior_set() will flush and reset all connections.
37
38 =over 4
39
40 =item MEMCACHED_BEHAVIOR_NO_BLOCK
41
42 Causes libmemcached(3) to use asychronous IO. This is the fastest transport
43 available.
44
45 =item MEMCACHED_BEHAVIOR_TCP_NODELAY
46
47 Turns on the no-delay feature for connecting sockets (may be faster in some
48 environments).
49
50 =item MEMCACHED_BEHAVIOR_HASH
51
52 Makes the default hashing algorithm for keys use MD5. The value can be set to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_KETAMA. The behavior for all hashes but MEMCACHED_HASH_DEFAULT is identitical to the Java driver written by Dustin Sallings.
53
54 =item MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
55
56 Memcached can cache named lookups so that DNS lookups are made only once.
57
58 =item MEMCACHED_BEHAVIOR_SUPPORT_CAS
59
60 Support CAS operations (this is not enabled by default at this point in the server since it imposes a slight performance penalty).
61
62 =back
63
64 =head1 RETURN
65
66 memcached_behavior_get() returns either the current value of the get, or 0
67 or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set()
68 returns whether or not the behavior was enabled.
69
70 =head1 HOME
71
72 To find out more information please check:
73 L<http://tangent.org/552/libmemcached.html>
74
75 =head1 AUTHOR
76
77 Brian Aker, E<lt>brian@tangent.orgE<gt>
78
79 =head1 SEE ALSO
80
81 memcached(1) libmemcached(3) memcached_strerror(3)
82
83 =cut
84