('memcached_memory_allocators', 'memcached_set_memory_allocators', u'libmemcached Documentation', [u'Brian Aker'], 3),
('memcached_memory_allocators', 'memcached_set_memory_allocators_context', u'libmemcached Documentation', [u'Brian Aker'], 3),
('memcached_pool', 'memcached_pool', u'libmemcached Documentation', [u'Brian Aker'], 3),
+ ('memcached_pool', 'memcached_pool_st', u'libmemcached Documentation', [u'Brian Aker'], 3),
('memcached_pool', 'memcached_pool_behavior_get', u'libmemcached Documentation', [u'Brian Aker'], 3),
('memcached_pool', 'memcached_pool_behavior_set', u'libmemcached Documentation', [u'Brian Aker'], 3),
('memcached_pool', 'memcached_pool_create', u'libmemcached Documentation', [u'Brian Aker'], 3),
docs/man/memcached_pool_destroy.3 \
docs/man/memcached_pool_pop.3 \
docs/man/memcached_pool_push.3 \
+ docs/man/memcached_pool_st.3 \
docs/man/memcached_prepend.3 \
docs/man/memcached_prepend_by_key.3 \
docs/man/memcached_quit.3 \
Libmemcached
------------
+
+######
+Basics
+######
+
+
.. toctree::
:maxdepth: 1
libmemcached
+ memcached_create
libmemcached_examples
libmemcached_configuration
- memcached_analyze
+
+
+#################
+Working with data
+#################
+
+.. toctree::
+ :maxdepth: 1
+
memcached_auto
- memcached_behavior
- memcached_callback
- memcached_create
memcached_delete
- memcached_dump
memcached_flush_buffers
memcached_flush
- memcached_generate_hash_value
memcached_get
+ memcached_result_st
+ memcached_set
+
+
+###############
+Advanced Topics
+###############
+
+.. toctree::
+ :maxdepth: 1
+
+ memcached_behavior
+ memcached_callback
+ memcached_dump
+ memcached_generate_hash_value
memcached_memory_allocators
memcached_quit
- memcached_result_st
memcached_sasl
- memcached_servers
memcached_server_st
- memcached_set
- memcached_stats
+ memcached_servers
memcached_strerror
memcached_user_data
memcached_verbosity
memcached_version
+#################################
+Deriving statistics from a server
+#################################
+
+.. toctree::
+ :maxdepth: 1
+
+ memcached_analyze
+ memcached_stats
+
----------------
Libmemcachedutil
----------------
hashkit_functions
hashkit_value
+==================
Indices and tables
==================
distribution. These are always up to date, and are used for each test run of
the library.
-------------------------------
-Creating and Freeing structure
-------------------------------
+-----------------------------------------------
+Creating and Freeing the memcached_st structure
+-----------------------------------------------
.. code-block:: c
In the above code you create a \ ``memcached_st``\ object with three server by making use of :manpage:`memcached_create_with_options(3)`.
+--------------------------
+Creating a pool of servers
+--------------------------
+
+
+
+.. code-block:: c
+
+ const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
+
+ memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
+
+ memcached_return_t rc;
+
+ memcached_st *memc= memcached_pool_pop(pool, false, &rc);
+
+ .... do work
+
+ /*
+ Release the memc_ptr that was pulled from the pool
+ */
+ memcached_pool_push(pool, memc);
+
+ /*
+ Destroy the pool.
+ */
+ memcached_pool_destroy(pool);
+
+
+
+In the above code you create a \ ``memcached_pool_st``\ object with three
+server by making use of :manpage:`memcached_pool(3)`.
+
+When memcached_pool_destroy() all memory will be released that is associated
+with the pool.
+
+
----------------------------
Adding a value to the server
----------------------------
-.TH "HASHKIT_CLONE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_CLONE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_clone \- libhashkit Documentation
.
-.TH "HASHKIT_CRC32" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_CRC32" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_crc32 \- libhashkit Documentation
.
-.TH "HASHKIT_CREATE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_CREATE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_create \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_32" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FNV1_32" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_fnv1_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_64" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FNV1_64" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_fnv1_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_32" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FNV1A_32" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_fnv1a_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_64" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FNV1A_64" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_fnv1a_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FREE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FREE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_free \- libhashkit Documentation
.
-.TH "HASHKIT_FUNCTIONS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_FUNCTIONS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_functions \- libhashkit Documentation
.
-.TH "HASHKIT_HSIEH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_HSIEH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_hsieh \- libhashkit Documentation
.
-.TH "HASHKIT_IS_ALLOCATED" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_IS_ALLOCATED" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_is_allocated \- libhashkit Documentation
.
-.TH "HASHKIT_JENKINS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_JENKINS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_jenkins \- libhashkit Documentation
.
-.TH "HASHKIT_MD5" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_MD5" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_md5 \- libhashkit Documentation
.
-.TH "HASHKIT_MURMUR" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_MURMUR" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_murmur \- libhashkit Documentation
.
-.TH "HASHKIT_VALUE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "HASHKIT_VALUE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
hashkit_value \- libhashkit Documentation
.
-.TH "LIBHASHKIT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBHASHKIT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libhashkit \- libhashkit Documentation
.
-.TH "LIBMEMCACHED" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBMEMCACHED" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libmemcached \- Introducing the C Client Library for memcached
.
-.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libmemcached_check_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libmemcached_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_EXAMPLES" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBMEMCACHED_EXAMPLES" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libmemcached_examples \- libmemcached Documentation
.
For full examples, test cases are found in tests/*.c in the main
distribution. These are always up to date, and are used for each test run of
the library.
-.SH CREATING AND FREEING STRUCTURE
+.SH CREATING AND FREEING THE MEMCACHED_ST STRUCTURE
.sp
.nf
.ft C
.fi
.sp
In the above code you create a \fBmemcached_st\fP object with three server by making use of \fImemcached_create_with_options(3)\fP.
+.SH CREATING A POOL OF SERVERS
+.sp
+.nf
+.ft C
+const char *config_string= "\-\-SERVER=host10.example.com \-\-SERVER=host11.example.com \-\-SERVER=host10.example.com";
+
+memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
+
+memcached_return_t rc;
+
+memcached_st *memc= memcached_pool_pop(pool, false, &rc);
+
+\&.... do work
+
+/*
+ Release the memc_ptr that was pulled from the pool
+*/
+memcached_pool_push(pool, memc);
+
+/*
+ Destroy the pool.
+*/
+memcached_pool_destroy(pool);
+.ft P
+.fi
+.sp
+In the above code you create a \fBmemcached_pool_st\fP object with three
+server by making use of \fImemcached_pool(3)\fP.
+.sp
+When memcached_pool_destroy() all memory will be released that is associated
+with the pool.
.SH ADDING A VALUE TO THE SERVER
.sp
.nf
-.TH "LIBMEMCACHEDUTIL" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "LIBMEMCACHEDUTIL" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
libmemcachedutil \- libmemcached Documentation
.
-.TH "MEMASLAP" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMASLAP" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memaslap \- libmemcached Documentation
.
.\" Man page generated from reStructeredText.
.
.SH SYNOPSIS
+.sp
+:program:: \fImemaslap\fP
.INDENT 0.0
.TP
.B \-\-help
-.TH "MEMCACHED_ADD" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_ADD" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_add \- Storing and Replacing Data
.
-.TH "MEMCACHED_ADD_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_ADD_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_add_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_ANALYZE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_ANALYZE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_analyze \- libmemcached Documentation
.
-.TH "MEMCACHED_APPEND" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_APPEND" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_append \- Storing and Replacing Data
.
-.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_append_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_AUTO" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_AUTO" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_auto \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_BEHAVIOR" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_behavior \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_behavior_get \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_behavior_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CALLBACK" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_callback \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_GET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CALLBACK_GET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_callback_get \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_SET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CALLBACK_SET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_callback_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CAS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CAS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_cas \- Storing and Replacing Data
.
-.TH "MEMCACHED_CAS_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CAS_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_cas_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_CLONE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CLONE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_clone \- libmemcached Documentation
.
-.TH "MEMCACHED_CREATE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CREATE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_create \- libmemcached Documentation
.
-.TH "MEMCACHED_CREATE_WITH_OPTIONS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_CREATE_WITH_OPTIONS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_create_with_options \- libmemcached Documentation
.
-.TH "MEMCACHED_DECREMENT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DECREMENT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_decrement \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_decrement_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DELETE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DELETE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_delete \- libmemcached Documentation
.
-.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_delete_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_destroy_sasl_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_DUMP" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_DUMP" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_dump \- libmemcached Documentation
.
-.TH "MEMCACHED_FETCH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FETCH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_fetch \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_fetch_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_RESULT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FETCH_RESULT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_fetch_result \- Retrieving data from the server
.
-.TH "MEMCACHED_FLUSH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FLUSH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_flush \- libmemcached Documentation
.
-.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_flush_buffers \- libmemcached Documentation
.
-.TH "MEMCACHED_FREE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_FREE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_free \- libmemcached Documentation
.
-.TH "MEMCACHED_GENERATE_HASH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_generate_hash \- Generating hash values directly
.
-.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_generate_hash_value \- Generating hash values directly
.
-.TH "MEMCACHED_GET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_get \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GET_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_get_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_get_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_get_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_USER_DATA" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_GET_USER_DATA" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_get_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_INCREMENT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_INCREMENT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_increment \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_increment_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_LIB_VERSION" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_LIB_VERSION" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_lib_version \- libmemcached Documentation
.
-.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_MGET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_MGET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_mget \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_MGET_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_mget_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_mget_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_mget_execute_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_POOL" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_behavior_get \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_behavior_set \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_CREATE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_CREATE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_create \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_DESTROY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_DESTROY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_destroy \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_POP" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_POP" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_pop \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
-.TH "MEMCACHED_POOL_PUSH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_POOL_PUSH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_pool_push \- libmemcached Documentation
.
#include <libmemcached/memcached_pool.h>
.INDENT 0.0
.TP
-.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.UNINDENT
.INDENT 0.0
.TP
Compile and link with \-lmemcachedutil \-lmemcached
.SH DESCRIPTION
.sp
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \fBmemcached_st\fP objects. The mmc argument should be an
-initialised \fBmemcached_st\fP structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \fBinitial\fP argument
-specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
.sp
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \fBmemcached_st\fP structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
.sp
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
--- /dev/null
+.TH "MEMCACHED_POOL_ST" "3" "April 10, 2011" "0.47" "libmemcached"
+.SH NAME
+memcached_pool_st \- libmemcached Documentation
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.\" Man page generated from reStructeredText.
+.
+.SH SYNOPSIS
+.sp
+#include <libmemcached/memcached_pool.h>
+.INDENT 0.0
+.TP
+.B memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_st * memcached_pool_destroy(memcached_pool_st* pool);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_st * memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_st *memcached_create (memcached_st *ptr);
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_return_t memcached_pool_behavior_set(memcached_pool_st\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ data\fP)
+.UNINDENT
+.INDENT 0.0
+.TP
+.B memcached_return_t memcached_pool_behavior_get(memcached_pool_st\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ *value\fP)
+.UNINDENT
+.sp
+Compile and link with \-lmemcachedutil \-lmemcached
+.SH DESCRIPTION
+.sp
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\fBmemcached_st\fPobjects. Please see \fIlibmemcached_configuration\fP for details on the format of the configuration string.
+.sp
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \fBmemcached_st\fPobjects. The mmc argument should be an
+initialised \fBmemcached_st\fPstructure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \fBinitial\fP argument specifies
+the initial size of the connection pool, and the \fBmax\fPargument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
+.sp
+memcached_pool_destroy() is used to destroy the connection pool
+created with memcached_pool_create() and release all allocated
+resources. It will return the pointer to the \fBmemcached_st\fP structure
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
+.sp
+memcached_pool_pop() is used to grab a connection structure from the
+connection pool. The block argument specifies if the function should
+block and wait for a connection structure to be available if we try
+to exceed the maximum size.
+.sp
+memcached_pool_push() is used to return a connection structure back to the pool.
+.sp
+memcached_pool_behavior_set() and memcached_pool_behagior_get() is
+used to get/set behavior flags on all connections in the pool.
+.SH RETURN
+.sp
+memcached_pool_create() returns a pointer to the newly created
+memcached_pool_st structure. On an allocation failure, it returns
+NULL.
+.sp
+memcached_pool_destroy() returns the pointer (and ownership) to the
+memcached_st structure used to create the pool. If connections are in
+use it returns NULL.
+.sp
+memcached_pool_pop() returns a pointer to a memcached_st structure
+from the pool (or NULL if an allocation cannot be satisfied).
+.sp
+memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
+.sp
+memcached_pool_behavior_get() and memcached_pool_behavior_get()
+returns MEMCACHED_SUCCESS upon success.
+.SH HOME
+.sp
+To find out more information please check:
+\fI\%https://launchpad.net/libmemcached\fP
+.SH AUTHOR
+.sp
+Brian Aker, <\fI\%brian@tangent.org\fP>
+.sp
+Trond Norbye, <\fI\%trond.norbye@gmail.com\fP>
+.SH SEE ALSO
+.sp
+\fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
+.SH AUTHOR
+Brian Aker
+.SH COPYRIGHT
+2011, Brian Aker DataDifferential, http://datadifferential.com/
+.\" Generated by docutils manpage writer.
+.\"
+.
-.TH "MEMCACHED_PREPEND" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_PREPEND" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_prepend \- Storing and Replacing Data
.
-.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_prepend_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_QUIT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_QUIT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_quit \- libmemcached Documentation
.
-.TH "MEMCACHED_REPLACE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_REPLACE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_replace \- Storing and Replacing Data
.
-.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_replace_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_RESULT_CAS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_CAS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_cas \- Working with result sets
.
-.TH "MEMCACHED_RESULT_CREATE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_CREATE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_create \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FLAGS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_FLAGS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_flags \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FREE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_FREE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_free \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_key_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_key_value \- Working with result sets
.
-.TH "MEMCACHED_RESULT_LENGTH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_LENGTH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_ST" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_ST" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_st \- Working with result sets
.
-.TH "MEMCACHED_RESULT_VALUE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_RESULT_VALUE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_result_value \- Working with result sets
.
-.TH "MEMCACHED_SASL" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SASL" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_sasl \- libmemcached Documentation
.
-.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_sasl_set_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_add \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_add_unix_socket \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_COUNT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_COUNT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_CURSOR" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_CURSOR" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_cursor \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_list \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_list_append \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_list_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_list_free \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_PUSH" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_PUSH" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_push \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ST" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVER_ST" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_server_st \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVERS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_servers \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_PARSE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVERS_PARSE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_servers_parse \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_RESET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SERVERS_RESET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_servers_reset \- libmemcached Documentation
.
-.TH "MEMCACHED_SET" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_BY_KEY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET_BY_KEY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set_memory_allocators_context \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_USER_DATA" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_SET_USER_DATA" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_set_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STAT" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stat \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_EXECUTE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STAT_EXECUTE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stat_execute \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stat_get_keys \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stat_get_value \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stat_servername \- libmemcached Documentation
.
-.TH "MEMCACHED_STATS" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STATS" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_stats \- libmemcached Documentation
.
-.TH "MEMCACHED_STRERROR" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_STRERROR" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_strerror \- libmemcached Documentation
.
-.TH "MEMCACHED_USER_DATA" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_USER_DATA" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_VERBOSITY" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_VERBOSITY" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_verbosity \- libmemcached Documentation
.
-.TH "MEMCACHED_VERSION" "3" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCACHED_VERSION" "3" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcached_version \- libmemcached Documentation
.
-.TH "MEMCAPABLE" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCAPABLE" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcapable \- libmemcached Documentation
.
.sp
Check the server for compatibility and capabilities
.SH SYNOPSIS
+.sp
+\fBmemcapable\fP
.INDENT 0.0
.TP
.B \-h hostname
-.TH "MEMCAT" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCAT" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcat \- libmemcached Documentation
.
.sp
Copy a set of keys to stdout
.SH SYNOPSIS
+.sp
+\fBmemcat\fP
.INDENT 0.0
.TP
.B \-\-help
-.TH "MEMCP" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMCP" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memcp \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemcp\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
-.TH "MEMDUMP" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMDUMP" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memdump \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemdump\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
-.TH "MEMERROR" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMERROR" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memerror \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemerror\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
-.TH "MEMFLUSH" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMFLUSH" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memflush \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemflush\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
-.TH "MEMRM" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMRM" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memrm \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemrm\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
-.TH "MEMSLAP" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMSLAP" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memslap \- libmemcached Documentation
.
.\" Man page generated from reStructeredText.
.
.SH SYNOPSIS
+.INDENT 0.0
+.TP
+.B program
+.
+\fImemslap\fP
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-help
+.UNINDENT
.SH DESCRIPTION
.sp
\fBmemslap\fP is a load generation and benchmark tool for memcached(1)
-.TH "MEMSTAT" "1" "April 09, 2011" "0.47" "libmemcached"
+.TH "MEMSTAT" "1" "April 10, 2011" "0.47" "libmemcached"
.SH NAME
memstat \- libmemcached Documentation
.
.SH SYNOPSIS
.INDENT 0.0
.TP
+.B program
+.
+\fImemstat\fP
+.UNINDENT
+.INDENT 0.0
+.TP
.B \-\-help
.UNINDENT
.SH DESCRIPTION
SYNOPSIS
--------
+:program:: `memaslap`
+
.. program:: memaslap
.. option:: --help
#include <libmemcached/memcached_pool.h>
-.. c:function:: memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
+.. c:function:: memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+
+.. c:function:: memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); DEPRECATED
.. c:function:: memcached_st * memcached_pool_destroy(memcached_pool_st* pool);
-----------
-memcached_pool_create() is used to create a connection pool of objects you
-may use to remove the overhead of using memcached_clone for short
-lived \ ``memcached_st``\ objects. The mmc argument should be an
-initialised \ ``memcached_st``\ structure, and a successfull invocation of
-memcached_pool_create takes full ownership of the variable (until it
-is released by memcached_pool_destroy). The \ ``initial``\ argument
-specifies the initial size of the connection pool, and the \ ``max``\
-argument specifies the maximum size the connection pool should grow
-to. Please note that the library will allocate a fixed size buffer
-scaled to the max size of the connection pool, so you should not pass
-MAXINT or some other large number here.
+memcached_pool() is used to create a connection pool of objects you may use
+to remove the overhead of using memcached_clone for short lived
+\ ``memcached_st``\ objects. Please see :manpage:`libmemcached_configuration` for details on the format of the configuration string.
+
+DEPRECATED memcached_pool_create() is used to create a connection pool of
+objects you may use to remove the overhead of using memcached_clone for
+short lived \ ``memcached_st``\ objects. The mmc argument should be an
+initialised \ ``memcached_st``\ structure, and a successfull invocation of
+memcached_pool_create takes full ownership of the variable (until it is
+released by memcached_pool_destroy). The \ ``initial``\ argument specifies
+the initial size of the connection pool, and the \ ``max``\ argument
+specifies the maximum size the connection pool should grow to. Please note
+that the library will allocate a fixed size buffer scaled to the max size of
+the connection pool, so you should not pass MAXINT or some other large
+number here.
memcached_pool_destroy() is used to destroy the connection pool
created with memcached_pool_create() and release all allocated
resources. It will return the pointer to the \ ``memcached_st``\ structure
-passed as an argument to memcached_pool_create(), and returns the
-ownership of the pointer to the caller.
+passed as an argument to memcached_pool_create(), and returns the ownership
+of the pointer to the caller when created with memcached_pool_create,
+otherwise NULL is returned..
memcached_pool_pop() is used to grab a connection structure from the
connection pool. The block argument specifies if the function should
SYNOPSIS
--------
-.. program:: memcat
+:program:`memcapable`
+
+.. program:: memcapable
.. option:: -h hostname
--------
+:program:`memcat`
.. program:: memcat
SYNOPSIS
--------
+:program: `memcp`
+
.. program:: memcp
.. option:: --help
SYNOPSIS
--------
+:program: `memdump`
+
.. program:: memdump
.. option:: --help
SYNOPSIS
--------
+:program: `memerror`
+
.. program:: memerror
.. option:: --help
SYNOPSIS
--------
+:program: `memflush`
+
.. program:: memflush
.. option:: --help
SYNOPSIS
--------
-
+:program: `memrm`
.. program:: memrm
--------
-.. program:: memslap [options]
+:program: `memslap`
+.. program:: memslap
+
+.. option:: --help
-----------
DESCRIPTION
SYNOPSIS
--------
+:program: `memstat`
+
.. program:: memstat
.. option:: --help
int flags;
do
+ {
flags= fcntl(ptr->fd, F_GETFL, 0);
+ }
while (flags == -1 && (errno == EINTR || errno == EAGAIN));
unlikely (flags == -1)
int rval;
do
+ {
rval= fcntl(ptr->fd, F_SETFL, flags | O_NONBLOCK);
+ }
while (rval == -1 && (errno == EINTR || errno == EAGAIN));
unlikely (rval == -1)
self->error_messages= NULL;
self->prefix_key= NULL;
+ self->configure.initial_pool_size= 1;
+ self->configure.max_pool_size= 1;
self->configure.filename= NULL;
return true;
struct memcached_error_t *error_messages;
struct memcached_array_st *prefix_key;
struct {
+ uint32_t initial_pool_size;
+ uint32_t max_pool_size;
struct memcached_array_st *filename;
} configure;
struct {
int firstfree;
uint32_t size;
uint32_t current_size;
+ bool _owns_master;
char *version;
};
return EXIT_SUCCESS;
}
-memcached_pool_st *memcached_pool_create(memcached_st* mmc,
- uint32_t initial, uint32_t max)
+static inline memcached_pool_st *_pool_create(memcached_st* mmc, uint32_t initial, uint32_t max)
{
- memcached_pool_st* ret = NULL;
- memcached_pool_st object = { .mutex = PTHREAD_MUTEX_INITIALIZER,
+ memcached_pool_st* ret= NULL;
+ memcached_pool_st object= { .mutex = PTHREAD_MUTEX_INITIALIZER,
.cond = PTHREAD_COND_INITIALIZER,
.master = mmc,
.mmc = calloc(max, sizeof(memcached_st*)),
- .firstfree = -1,
+ .firstfree= -1,
.size = max,
- .current_size = 0 };
+ .current_size= 0,
+ ._owns_master= false};
if (object.mmc != NULL)
{
return ret;
}
+memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initial, uint32_t max)
+{
+ return _pool_create(mmc, initial, max);
+}
+
+memcached_pool_st * memcached_pool(const char *option_string, size_t option_string_length)
+{
+ memcached_pool_st *self;
+ memcached_st *memc= memcached_create_with_options(option_string, option_string_length);
+
+ if (! memc)
+ return NULL;
+
+ self= memcached_pool_create(memc, memc->configure.initial_pool_size, memc->configure.max_pool_size);
+ if (self)
+ {
+ self->_owns_master= true;
+ }
+ else
+ {
+ memcached_free(memc);
+ }
+
+ return self;
+}
+
memcached_st* memcached_pool_destroy(memcached_pool_st* pool)
{
- memcached_st *ret = pool->master;
+ if (! pool)
+ return NULL;
+
+ memcached_st *ret= pool->master;
for (int xx= 0; xx <= pool->firstfree; ++xx)
{
pthread_mutex_destroy(&pool->mutex);
pthread_cond_destroy(&pool->cond);
free(pool->mmc);
+ if (pool->_owns_master)
+ {
+ memcached_free(pool->master);
+ ret= NULL;
+ }
free(pool);
return ret;
do
{
if (pool->firstfree > -1)
+ {
ret= pool->mmc[pool->firstfree--];
+ }
else if (pool->current_size == pool->size)
{
if (!block)
if (pthread_cond_wait(&pool->cond, &pool->mutex) == -1)
{
- int err = errno;
+ int err= errno;
mutex_exit(&pool->mutex);
- errno = err;
+ errno= err;
*rc= MEMCACHED_ERRNO;
return NULL;
}
{
rc= memcached_behavior_set(pool->mmc[xx], flag, data);
if (rc == MEMCACHED_SUCCESS)
+ {
memcached_set_user_data(pool->mmc[xx], pool->version);
+ }
else
{
memcached_free(pool->mmc[xx]);
memset(pool->mmc[xx], 0, sizeof(*pool->mmc[xx]));
+
if (memcached_clone(pool->mmc[xx], pool->master) == NULL)
{
/* I'm not sure what to do in this case.. this would happen
typedef struct memcached_pool_st memcached_pool_st;
LIBMEMCACHED_API
-memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initial,
- uint32_t max);
+memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initial, uint32_t max);
+
+LIBMEMCACHED_API
+memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
+
LIBMEMCACHED_API
memcached_st* memcached_pool_destroy(memcached_pool_st* pool);
+
LIBMEMCACHED_API
memcached_st* memcached_pool_pop(memcached_pool_st* pool,
bool block,
tests/ketama_test_cases_spy.h \
tests/libmemcached_world.h \
tests/parser.h \
+ tests/pool.h \
tests/print.h \
tests/replication.h \
tests/string.h \
tests/error_conditions.cc \
tests/mem_functions.c \
tests/parser.cc \
+ tests/pool.cc \
tests/print.cc \
tests/replication.cc \
tests/string.cc \
#include <libtest/test.h>
#include "tests/parser.h"
+#include "tests/pool.h"
#include "tests/string.h"
#include "tests/replication.h"
#include "tests/basic.h"
{"delete_through", 1, (test_callback_fn)delete_through },
{"noreply", 1, (test_callback_fn)noreply_test},
{"analyzer", 1, (test_callback_fn)analyzer_test},
-#ifdef HAVE_LIBMEMCACHEDUTIL
{"connectionpool", 1, (test_callback_fn)connection_pool_test },
+ {"memcached_pool_test", 1, (test_callback_fn)memcached_pool_test },
{"ping", 1, (test_callback_fn)ping_test },
-#endif
{"test_get_last_disconnect", 1, (test_callback_fn)test_get_last_disconnect},
{"verbosity", 1, (test_callback_fn)test_verbosity},
{"test_server_failure", 1, (test_callback_fn)test_server_failure},
#define BUILDING_LIBMEMCACHED
#include <libmemcached/memcached.h>
+#include <libmemcached/memcached.h>
#include "tests/parser.h"
#include "tests/print.h"
break;
case ENOMEM:
std::cerr << "Failed to allocate memory for memcached_create_with_options()" << std::endl;
+ memcached_free(memc_ptr);
return TEST_FAILURE;
default:
std::cerr << "Unknown error from memcached_create_with_options?!!" << std::endl;
+ memcached_free(memc_ptr);
return TEST_FAILURE;
}
}
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
- * Gearmand client and server library.
+ * Libmemcached
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* All rights reserved.
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached Client and Server
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+
+#include <vector>
+#include <iostream>
+#include <string>
+#include <errno.h>
+
+#include <libmemcached/memcached.h>
+#include <libmemcached/util.h>
+#include <tests/pool.h>
+
+test_return_t memcached_pool_test(memcached_st *)
+{
+ const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
+ memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
+
+ memcached_return_t rc;
+ memcached_st *memc= memcached_pool_pop(pool, false, &rc);
+
+ test_true(rc == MEMCACHED_SUCCESS);
+ test_true(memc);
+
+ /*
+ Release the memc_ptr that was pulled from the pool
+ */
+ memcached_pool_push(pool, memc);
+
+ /*
+ Destroy the pool.
+ */
+ memcached_pool_destroy(pool);
+
+ return TEST_SUCCESS;
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached client and server library.
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <libtest/test.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBTEST_INTERNAL_API
+test_return_t memcached_pool_test(memcached_st *);
+
+#ifdef __cplusplus
+}
+#endif