Author: rfm
Date: Fri Jun 20 10:35:33 2014
New Revision: 37953
URL: http://svn.gna.org/viewcvs/gnustep?rev=37953&view=rev
Log:
more pool improvements
Modified:
libs/sqlclient/trunk/ChangeLog
libs/sqlclient/trunk/SQLClient.h
Modified: libs/sqlclient/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/ChangeLog?rev=37953&r1=37952&r2=37953&view=diff
==============================================================================
--- libs/sqlclient/trunk/ChangeLog (original)
+++ libs/sqlclient/trunk/ChangeLog Fri Jun 20 10:35:33 2014
@@ -1,3 +1,12 @@
+2014-06-20 Richard Frith-Macdonald <[email protected]>
+
+ * SQLClient.h: Add SQLClientPool, new method to check idle clients
+ and new initialiser.
+ * SQLClient.m: Changes to support pools of clients and permit a pool
+ to contain multiple clients with the same config.
+ * SQLClientPool.m: new class to provide a pool of clients with the
+ same config.
+
2014-05-27 Richard Frith-Macdonald <[email protected]>
* SQLClient.h: Warn about not using the database inside a
Modified: libs/sqlclient/trunk/SQLClient.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.h?rev=37953&r1=37952&r2=37953&view=diff
==============================================================================
--- libs/sqlclient/trunk/SQLClient.h (original)
+++ libs/sqlclient/trunk/SQLClient.h Fri Jun 20 10:35:33 2014
@@ -1409,6 +1409,8 @@
SQLClient **p; /** The proxies of the pool. */
int max; /** Maximum connection count */
int min; /** Minimum connection count */
+ NSTimeInterval _duration; /** Duration logging threshold */
+ unsigned int _debugging; /** The current debugging level */
}
/**
@@ -1427,20 +1429,46 @@
max: (int)maxConnections
min: (int)minConnections;
-/** Fetches an (autoreleased) proxy to a client from the pool.
+/** Fetches an (autoreleased) proxy to a client from the pool.<br />
+ * This method blocks indefinitely waiting for a client to become
+ * available in the pool.
*/
- (SQLClient*) provideClient;
+/** Fetches an (autoreleased) proxy to a client from the pool.<br />
+ * If no client is or becomes available before the specified date then
+ * the method returns nil.<br />
+ * If when is nil then a date in the distant future is used so that
+ * the method will effectively wait forever to get a client.
+ */
+- (SQLClient*) provideClientBeforeDate: (NSDate*)when;
+
/**
* Sets the cache for all the clients in the pool.
*/
- (void) setCache: (GSCache*)aCache;
+
+/**
+ * Sets the cache thread for all the clients in the pool.
+ */
+- (void) setCacheThread: (NSThread*)aThread;
+
+/** Set the debugging level for all clients in the pool.
+ */
+- (void) setDebugging: (unsigned int)level;
+
+/** Set the duration logging threshold for all clients in the pool.
+ */
+- (void) setDurationLogging: (NSTimeInterval)threshold;
/** Takes the client form the provided proxy and places it back
* in the queue (so the proxy stops using it). This happens automatically
- * when the proxy is deallocated so you don't generally needs to do it.
+ * when the proxy is deallocated so you don't generally needs to do it.<br />
* Returns YES if the supplied proxy referred to a client in the pool,
- * NO otherwise.
+ * NO otherwise.<br />
+ * If the swallowed client would take the count of idle client connections
+ * in the pool above the configured minimum, the oldest (ie longest idle)
+ * client in the pool is disconnected.
*/
- (BOOL) swallowClient: (SQLClient*)proxy;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs