diff --git a/README.md b/README.md index 3f8eb840c426f81c6762f74b5dc4e199f05de059..6def76e15eb6c078fa566ed7e3a90d228febe3df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [aiogremlin 0.1.0](https://pypi.python.org/pypi/aiogremlin/0.0.11) +# [aiogremlin 0.1.3](https://pypi.python.org/pypi/aiogremlin/0.0.11) ## [Official Documentation](http://aiogremlin.readthedocs.org/en/latest/) diff --git a/aiogremlin/client.py b/aiogremlin/client.py index 9481730070b22925fdc372d8789ff25e44d53a56..6f4459bf4b3c52a000536389dd95763449de04ec 100644 --- a/aiogremlin/client.py +++ b/aiogremlin/client.py @@ -26,10 +26,12 @@ class GremlinClient: "gremlin-groovy" by default :param str op: Gremlin Server op argument. "eval" by default. :param str processor: Gremlin Server processor argument. "" by default. - :param float timeout: timeout for establishing connection (optional). + :param float timeout: timeout for websocket read (seconds)(optional). Values ``0`` or ``None`` mean no timeout :param ws_connector: A class that implements the method ``ws_connect``. Usually an instance of ``aiogremlin.connector.GremlinConnector`` + :param float conn_timeout: timeout for establishing connection (seconds) + (optional). Values ``0`` or ``None`` mean no timeout :param username: Username for SASL auth :param password: Password for SASL auth """ @@ -37,7 +39,7 @@ class GremlinClient: def __init__(self, *, url='http://localhost:8182/', loop=None, lang="gremlin-groovy", op="eval", processor="", timeout=None, ws_connector=None, client_session=None, - username="", password=""): + conn_timeout=None, username="", password=""): self._lang = lang self._op = op self._processor = processor @@ -50,7 +52,8 @@ class GremlinClient: self._password = password if ws_connector is None: ws_connector = GremlinConnector(loop=self._loop, - client_session=client_session) + client_session=client_session, + conn_timeout=conn_timeout) self._connector = ws_connector @property @@ -355,6 +358,7 @@ def submit(gremlin, *, timeout=None, session=None, loop=None, + conn_timeout=None, username="", password=""): """ @@ -378,6 +382,8 @@ def submit(gremlin, *, :param loop: :ref:`event loop<asyncio-event-loop>` If param is ``None``, `asyncio.get_event_loop` is used for getting default event loop (optional) + :param float conn_timeout: timeout for establishing connection (seconds) + (optional). Values ``0`` or ``None`` mean no timeout :param username: Username for SASL auth :param password: Password for SASL auth :returns: :py:class:`aiogremlin.client.GremlinResponse` object @@ -387,7 +393,8 @@ def submit(gremlin, *, loop = asyncio.get_event_loop() connector = aiohttp.TCPConnector(force_close=True, loop=loop, - verify_ssl=False) + verify_ssl=False, + conn_timeout=conn_timeout) client_session = aiohttp.ClientSession( connector=connector, loop=loop, diff --git a/aiogremlin/connector.py b/aiogremlin/connector.py index 5c9fa791e5bca98d71851c18b0f5364cf55af70b..f3eae44c5ab613ab0797d84e7b0067b3680f7783 100644 --- a/aiogremlin/connector.py +++ b/aiogremlin/connector.py @@ -13,8 +13,8 @@ class GremlinConnector(WebSocketConnector): """Create and manage reusable websocket connections. Out of the box support for multiple enpoints (databases). - :param float conn_timeout: timeout for establishing connection (optional). - Values ``0`` or ``None`` mean no timeout + :param float conn_timeout: timeout for establishing connection (seconds) + (optional). Values ``0`` or ``None`` mean no timeout :param bool force_close: close websockets after release :param int limit: limit for total open websocket connections :param aiohttp.client.ClientSession client_session: Underlying HTTP diff --git a/docs/index.rst b/docs/index.rst index a7baafbf3983928218145df271ac7c48b3778e1d..785e7a599080f1f1ec23596bcdd4567ade9b37f7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,7 +12,7 @@ based on the `asyncio`_ and `aiohttp`_ libraries. Releases ======== -The latest release of :py:mod:`aiogremlin` is **0.1.2**. +The latest release of :py:mod:`aiogremlin` is **0.1.3**. Requirements diff --git a/docs/usage.rst b/docs/usage.rst index df8e3cddedbc0600f503a7bf3554ebe0c31de9fc..28a3e65bf015ba364c54136aa202132e23da89a4 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -58,7 +58,7 @@ read the chunked responses one at a time:: :param str processor: Gremlin Server processor argument. "" by default. - :param float timeout: timeout for establishing connection (optional). + :param float timeout: timeout for websocket read (seconds)(optional). Values ``0`` or ``None`` mean no timeout :param str session: Session id (optional). Typically a uuid @@ -67,8 +67,11 @@ read the chunked responses one at a time:: `asyncio.get_event_loop` is used for getting default event loop (optional) + :param float conn_timeout: timeout for establishing connection (seconds) + (optional). Values ``0`` or ``None`` mean no timeout + :param username: Username for SASL auth - + :param password: Password for SASL auth :returns: :py:class:`aiogremlin.client.GremlinResponse` object diff --git a/setup.py b/setup.py index 3463d36a04b3cdab6f59e6eba0bdfcff831bc912..78cd7c4b25fa282326c45ab8b34f15c9c4f4b9f5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name="aiogremlin", - version="0.1.2", + version="0.1.3", url="", license="MIT", author="davebshow", @@ -13,7 +13,7 @@ setup( packages=["aiogremlin", "tests"], install_requires=[ "aiohttp==0.18.4", - "aiowebsocketclient==0.0.4" + "aiowebsocketclient==0.0.5" ], test_suite="tests", classifiers=[