libmongo-client 0.1.4
|
00001 /* mongo-sync-pool.h - libmongo-client connection pool API 00002 * Copyright 2011 Gergely Nagy <algernon@balabit.hu> 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00024 #ifndef LIBMONGO_POOL_H 00025 #define LIBMONGO_POOL_H 1 00026 00027 #include <mongo-sync.h> 00028 #include <glib.h> 00029 00030 G_BEGIN_DECLS 00031 00049 typedef struct _mongo_sync_pool_connection mongo_sync_pool_connection; 00050 00055 typedef struct _mongo_sync_pool mongo_sync_pool; 00056 00079 mongo_sync_pool *mongo_sync_pool_new (const gchar *host, 00080 gint port, 00081 gint nmasters, gint nslaves); 00082 00089 void mongo_sync_pool_free (mongo_sync_pool *pool); 00090 00109 mongo_sync_pool_connection *mongo_sync_pool_pick (mongo_sync_pool *pool, 00110 gboolean want_master); 00111 00124 gboolean mongo_sync_pool_return (mongo_sync_pool *pool, 00125 mongo_sync_pool_connection *conn); 00126 00131 G_END_DECLS 00132 00133 #endif