Fix Trond's email address.
[awesomized/libmemcached] / docs / memcached_pool.pod
1 =head1 NAME
2
3 memcached_pool_create, memcached_pool_destroy, memcached_pool_push, memcached_pool_pop - Manage pools
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcachedutil, -lmemcachedutil)
8
9 =head1 SYNOPSIS
10
11 #include <libmemcached/memcached_pool.h>
12
13 memcached_pool_st *
14 memcached_pool_create(memcached_st* mmc, int initial, int max);
15
16 memcached_st *
17 memcached_pool_destroy(memcached_pool_st* pool);
18
19 memcached_st *
20 memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
21
22 memcached_return_t
23 memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
24
25 memcached_st *memcached_create (memcached_st *ptr);
26
27 memcached_return_t
28 memcached_pool_behavior_set(memcached_pool_st *pool,
29 memcached_behavior_t flag,
30 uint64_t data)
31
32 memcached_return_t
33 memcached_pool_behavior_get(memcached_pool_st *pool,
34 memcached_behavior_t flag,
35 uint64_t *value)
36
37 =head1 DESCRIPTION
38
39 memcached_pool_create() is used to create a connection pool of objects you
40 may use to remove the overhead of using memcached_clone for short
41 lived C<memcached_st> objects. The mmc argument should be an
42 initialised C<memcached_st> structure, and a successfull invocation of
43 memcached_pool_create takes full ownership of the variable (until it
44 is released by memcached_pool_destroy). The C<initial> argument
45 specifies the initial size of the connection pool, and the C<max>
46 argument specifies the maximum size the connection pool should grow
47 to. Please note that the library will allocate a fixed size buffer
48 scaled to the max size of the connection pool, so you should not pass
49 MAXINT or some other large number here.
50
51 memcached_pool_destroy() is used to destroy the connection pool
52 created with memcached_pool_create() and release all allocated
53 resources. It will return the pointer to the C<memcached_st> structure
54 passed as an argument to memcached_pool_create(), and returns the
55 ownership of the pointer to the caller.
56
57 memcached_pool_pop() is used to grab a connection structure from the
58 connection pool. The block argument specifies if the function should
59 block and wait for a connection structure to be available if we try
60 to exceed the maximum size.
61
62 memcached_pool_push() is used to return a connection structure back to the pool.
63
64 memcached_pool_behavior_set() and memcached_pool_behagior_get() is
65 used to get/set behavior flags on all connections in the pool.
66
67
68 =head1 RETURN
69
70 memcached_pool_create() returns a pointer to the newly created
71 memcached_pool_st structure. On an allocation failure, it returns
72 NULL.
73
74 memcached_pool_destroy() returns the pointer (and ownership) to the
75 memcached_st structure used to create the pool. If connections are in
76 use it returns NULL.
77
78 memcached_pool_pop() returns a pointer to a memcached_st structure
79 from the pool (or NULL if an allocation cannot be satisfied).
80
81 memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
82
83 memcached_pool_behavior_get() and memcached_pool_behavior_get()
84 returns MEMCACHED_SUCCESS upon success.
85
86 =head1 HOME
87
88 To find out more information please check:
89 L<https://launchpad.net/libmemcached>
90
91 =head1 AUTHOR
92
93 Trond Norbye, E<lt>trond.norbye@gmail.comE<gt>
94
95 =head1 SEE ALSO
96
97 memcached(1) libmemcached(3) memcached_create(3) memcached_free(3) libmemcachedutil(3) memcached_behavior_get(3) memcached_behavior_set(3)
98
99 =cut