Skip to content

Commit

Permalink
Version 2.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Oct 31, 2016
1 parent 5ad0993 commit 0d84446
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2016.10.31, Version 2.0.6 (BETA)

- Add hasConnections() method.

2016.10.31, Version 2.0.5 (BETA)

- Fixed bug in re-connect loop. (issue #4)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup
import setuptools

VERSION = '2.0.5'
VERSION = '2.0.6'

setup(
name='siridb-connector-twisted',
Expand Down
2 changes: 1 addition & 1 deletion siridb/twisted/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .lib.client import SiriDBClientTwisted


__version_info__ = (2, 0, 5)
__version_info__ = (2, 0, 6)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Jeroen van der Heijden'
__email__ = 'jeroen@transceptor.technology'
Expand Down
8 changes: 8 additions & 0 deletions siridb/twisted/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,11 @@ def _getRandomConnection(self, tryUnavailable=False):
return random.choice(connections)

raise PoolError('No available connections found')

@property
def hasConnections(self):
'''Returns True when having at least one available connection.'''
for factory in self._factory_pool:
if factory.isAvailable:
return True
return False

0 comments on commit 0d84446

Please sign in to comment.