You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class EPPPool(ConnectionPool):
def _new_connection(self):
try:
return EPPSession(self.config)
except Exception as e:
# If the pool fails to start or gets too small, quit
if len(self.conn) < self.size / 2:
logging.error("Pool unhealthy, quitting")
os.kill(os.getpid(), signal.SIGTERM)
raise e
this works fine, but technically I'd like the pool to die while it's getting constructed (and not asynchronously).
I would like to propose a minimum_size, which gets created synchronously in ConnectionPool.__init__. The minimum number of connections could be created immediately (self._addOne()) and the constructor would raise an exception if creating them fails, then the remaining size - minimum_size connections get created as usual (gevent.spawn_later(self.SPAWN_FREQUENCY*i, self._addOne)).
How do you feel about this change? It's pretty small and restricted to ConnectionPool.__init__.
Thanks, great little module!
The text was updated successfully, but these errors were encountered:
I currently instantiate my pool like this:
this works fine, but technically I'd like the pool to die while it's getting constructed (and not asynchronously).
I would like to propose a
minimum_size
, which gets created synchronously inConnectionPool.__init__
. The minimum number of connections could be created immediately (self._addOne()
) and the constructor would raise an exception if creating them fails, then the remainingsize - minimum_size
connections get created as usual (gevent.spawn_later(self.SPAWN_FREQUENCY*i, self._addOne)
).How do you feel about this change? It's pretty small and restricted to
ConnectionPool.__init__
.Thanks, great little module!
The text was updated successfully, but these errors were encountered: