Skip to content

Commit

Permalink
Added connect
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Feb 10, 2023
1 parent 35253bd commit 6b57f82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion siridb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version_info__ = (2, 1, 0)
__version_info__ = (2, 1, 1)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Jeroen van der Heijden'
__email__ = 'jeroen@cesbit.com'
5 changes: 5 additions & 0 deletions siridb/connector/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .constants import NANOSECOND
from .protomap import CPROTO_REQ_QUERY
from .protomap import CPROTO_REQ_INSERT
from .protomap import CPROTO_REQ_PING
from .logging import logger as logging


Expand Down Expand Up @@ -422,6 +423,10 @@ async def wait_closed(self):
if self._protocol and hasattr(self._protocol, 'close_future'):
await self._protocol.close_future

async def connect(self, timeout=120):
result = await self._ensure_write(CPROTO_REQ_PING, timeout=timeout)
return result

async def query(self, query, time_precision=None, timeout=60):
assert isinstance(query, (str, bytes)), \
'query should be of type str, unicode or bytes'
Expand Down

0 comments on commit 6b57f82

Please sign in to comment.